001    /*
002     * Copyright 2004 Chris Nelson
003     *
004     * Licensed under the Apache License, Version 2.0 (the "License");
005     * you may not use this file except in compliance with the License.
006     * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
007     * Unless required by applicable law or agreed to in writing,
008     * software distributed under the License is distributed on an "AS IS" BASIS,
009     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
010     * See the License for the specific language governing permissions and limitations under the License.
011     */
012    package org.tynamo.descriptor;
013    
014    
015    /**
016     * @author fus8882
017     *         <p/>
018     *         TODO To change the template for this generated type comment go to
019     *         Window - Preferences - Java - Code Style - Code Templates
020     */
021    public class IdentifierDescriptorImpl extends TynamoPropertyDescriptorImpl implements IdentifierDescriptor
022    {
023            private boolean generated = true;
024    
025            public IdentifierDescriptorImpl(Class beanType, TynamoPropertyDescriptor descriptor)
026            {
027                    super(beanType, descriptor.getPropertyType());
028                    copyFrom(descriptor);
029                    setSearchable(false);
030            }
031    
032            /**
033             * @param realDescriptor
034             */
035            public IdentifierDescriptorImpl(Class beanType, Class type)
036            {
037                    super(beanType, type);
038                    setSearchable(false);
039            }
040    
041            /* (non-Javadoc)
042                     * @see org.tynamo.descriptor.PropertyDescriptor#isIdentifier()
043                     */
044            public boolean isIdentifier()
045            {
046                    return true;
047            }
048    
049            /**
050             * @return Returns the generated.
051             */
052            public boolean isGenerated()
053            {
054                    return generated;
055            }
056    
057            /**
058             * @param generated The generated to set.
059             */
060            public void setGenerated(boolean generated)
061            {
062                    this.generated = generated;
063            }
064    
065            public Object clone()
066            {
067                    return new IdentifierDescriptorImpl(getBeanType(), this);
068            }
069    
070    
071    }