clone.setInsertable( false ); clone.setUpdateable( false ); clone.setNaturalIdentifier( false ); clone.setValueGenerationStrategy( property.getValueGenerationStrategy() ); embeddedComp.addProperty( clone );
private void handleNaturalIdBinding( MappingDocument mappingDocument, PersistentClass entityBinding, Property attributeBinding, NaturalIdMutability naturalIdMutability) { if ( naturalIdMutability == NaturalIdMutability.NOT_NATURAL_ID ) { return; } attributeBinding.setNaturalIdentifier( true ); if ( naturalIdMutability == NaturalIdMutability.IMMUTABLE ) { attributeBinding.setUpdateable( false ); } NaturalIdUniqueKeyBinder ukBinder = mappingDocument.getMetadataCollector().locateNaturalIdUniqueKeyBinder( entityBinding.getEntityName() ); if ( ukBinder == null ) { ukBinder = new NaturalIdUniqueKeyBinderImpl( mappingDocument, entityBinding ); mappingDocument.getMetadataCollector().registerNaturalIdUniqueKeyBinder( entityBinding.getEntityName(), ukBinder ); } ukBinder.addAttributeBinding( attributeBinding ); }
newProperty.setMetaAttributes( current.getMetaAttributes() ); newProperty.setName( current.getName() ); newProperty.setNaturalIdentifier( false );
/** * create a property copy reusing the same value */ public static Property shallowCopy(Property property) { Property clone = new Property(); clone.setCascade( property.getCascade() ); clone.setInsertable( property.isInsertable() ); clone.setLazy( property.isLazy() ); clone.setName( property.getName() ); clone.setNaturalIdentifier( property.isNaturalIdentifier() ); clone.setOptimisticLocked( property.isOptimisticLocked() ); clone.setOptional( property.isOptional() ); clone.setPersistentClass( property.getPersistentClass() ); clone.setPropertyAccessorName( property.getPropertyAccessorName() ); clone.setSelectable( property.isSelectable() ); clone.setUpdateable( property.isUpdateable() ); clone.setValue( property.getValue() ); return clone; }
updatable = false; prop.setNaturalIdentifier( true );
clone.setInsertable( false ); clone.setUpdateable( false ); clone.setNaturalIdentifier( false ); clone.setGeneration( property.getGeneration() ); embeddedComp.addProperty( clone );
newProperty.setName( current.getName() ); newProperty.setNodeName( current.getNodeName() ); newProperty.setNaturalIdentifier( false );
updatable = false; prop.setNaturalIdentifier( true );
/** * create a property copy reusing the same value */ public static Property shallowCopy(Property property) { Property clone = new Property(); clone.setCascade( property.getCascade() ); clone.setInsertable( property.isInsertable() ); clone.setLazy( property.isLazy() ); clone.setName( property.getName() ); clone.setNodeName( property.getNodeName() ); clone.setNaturalIdentifier( property.isNaturalIdentifier() ); clone.setOptimisticLocked( property.isOptimisticLocked() ); clone.setOptional( property.isOptional() ); clone.setPersistentClass( property.getPersistentClass() ); clone.setPropertyAccessorName( property.getPropertyAccessorName() ); clone.setSelectable( property.isSelectable() ); clone.setUpdateable( property.isUpdateable() ); clone.setValue( property.getValue() ); return clone; }
private static void bindNaturalIdentifier(Table table, Mapping mapping, PersistentClass persistentClass) { Object o = mapping != null ? mapping.getIdentity() : null; if (!(o instanceof Identity)) { return; } Identity identity = (Identity) o; final NaturalId naturalId = identity.getNatural(); if (naturalId == null || naturalId.getPropertyNames().isEmpty()) { return; } UniqueKey uk = new UniqueKey(); uk.setName("_UniqueKey"); uk.setTable(table); boolean mutable = naturalId.isMutable(); for (String propertyName : naturalId.getPropertyNames()) { Property property = persistentClass.getProperty(propertyName); property.setNaturalIdentifier(true); if (!mutable) property.setUpdateable(false); uk.addColumns(property.getColumnIterator()); } table.addUniqueKey(uk); }
protected void bindNaturalIdentifier(Table table, Mapping mapping, PersistentClass persistentClass) { Object o = mapping != null ? mapping.getIdentity() : null; if (!(o instanceof Identity)) { return; } Identity identity = (Identity) o; final NaturalId naturalId = identity.getNatural(); if (naturalId == null || naturalId.getPropertyNames().isEmpty()) { return; } UniqueKey uk = new UniqueKey(); uk.setTable(table); boolean mutable = naturalId.isMutable(); for (String propertyName : naturalId.getPropertyNames()) { Property property = persistentClass.getProperty(propertyName); property.setNaturalIdentifier(true); if (!mutable) property.setUpdateable(false); uk.addColumns(property.getColumnIterator()); } setGeneratedUniqueName(uk); table.addUniqueKey(uk); }
private void handleNaturalIdBinding( MappingDocument mappingDocument, PersistentClass entityBinding, Property attributeBinding, NaturalIdMutability naturalIdMutability) { if ( naturalIdMutability == NaturalIdMutability.NOT_NATURAL_ID ) { return; } attributeBinding.setNaturalIdentifier( true ); if ( naturalIdMutability == NaturalIdMutability.IMMUTABLE ) { attributeBinding.setUpdateable( false ); } NaturalIdUniqueKeyBinder ukBinder = mappingDocument.getMetadataCollector().locateNaturalIdUniqueKeyBinder( entityBinding.getEntityName() ); if ( ukBinder == null ) { ukBinder = new NaturalIdUniqueKeyBinderImpl( mappingDocument, entityBinding ); mappingDocument.getMetadataCollector().registerNaturalIdUniqueKeyBinder( entityBinding.getEntityName(), ukBinder ); } ukBinder.addAttributeBinding( attributeBinding ); }
clone.setInsertable(false); clone.setUpdateable(false); clone.setNaturalIdentifier(false); clone.setValueGenerationStrategy(property.getValueGenerationStrategy()); embeddedComp.addProperty(clone);
clone.setInsertable(false); clone.setUpdateable(false); clone.setNaturalIdentifier(false); clone.setValueGenerationStrategy(property.getValueGenerationStrategy()); embeddedComp.addProperty(clone);
public Property shallowCopy() { Property clone = new Property( context ); clone.setCascade( getCascade() ); clone.setInsertable( isInsertable() ); clone.setLazy( isLazy() ); clone.setName( getName() ); clone.setNaturalIdentifier( isNaturalIdentifier() ); clone.setOptimisticLocked( isOptimisticLocked() ); clone.setOptional( isOptional() ); clone.setPersistentClass( (PersistentClass) getEntity() ); clone.setPropertyAccessorName( getPropertyAccessorName() ); clone.setSelectable( isSelectable() ); clone.setUpdateable( isUpdateable() ); clone.setValue( getValue() ); return clone; } }
/** * create a property copy reusing the same value */ public static Property shallowCopy(Property property) { Property clone = new Property(); clone.setCascade( property.getCascade() ); clone.setInsertable( property.isInsertable() ); clone.setLazy( property.isLazy() ); clone.setName( property.getName() ); clone.setNaturalIdentifier( property.isNaturalIdentifier() ); clone.setOptimisticLocked( property.isOptimisticLocked() ); clone.setOptional( property.isOptional() ); clone.setPersistentClass( property.getPersistentClass() ); clone.setPropertyAccessorName( property.getPropertyAccessorName() ); clone.setSelectable( property.isSelectable() ); clone.setUpdateable( property.isUpdateable() ); clone.setValue( property.getValue() ); return clone; }
/** * create a property copy reusing the same value */ public static Property shallowCopy(Property property) { Property clone = new Property(); clone.setCascade( property.getCascade() ); clone.setInsertable( property.isInsertable() ); clone.setLazy( property.isLazy() ); clone.setName( property.getName() ); clone.setNodeName( property.getNodeName() ); clone.setNaturalIdentifier( property.isNaturalIdentifier() ); clone.setOptimisticLocked( property.isOptimisticLocked() ); clone.setOptional( property.isOptional() ); clone.setPersistentClass( property.getPersistentClass() ); clone.setPropertyAccessorName( property.getPropertyAccessorName() ); clone.setSelectable( property.isSelectable() ); clone.setUpdateable( property.isUpdateable() ); clone.setValue( property.getValue() ); return clone; }
/** * create a property copy reusing the same value */ public static Property shallowCopy(Property property) { Property clone = new Property(); clone.setCascade( property.getCascade() ); clone.setInsertable( property.isInsertable() ); clone.setLazy( property.isLazy() ); clone.setName( property.getName() ); clone.setNodeName( property.getNodeName() ); clone.setNaturalIdentifier( property.isNaturalIdentifier() ); clone.setOptimisticLocked( property.isOptimisticLocked() ); clone.setOptional( property.isOptional() ); clone.setPersistentClass( property.getPersistentClass() ); clone.setPropertyAccessorName( property.getPropertyAccessorName() ); clone.setSelectable( property.isSelectable() ); clone.setUpdateable( property.isUpdateable() ); clone.setValue( property.getValue() ); return clone; }
updatable = false; prop.setNaturalIdentifier( true );
updatable = false; prop.setNaturalIdentifier( true );