Property clone = BinderHelper.shallowCopy( property ); clone.setInsertable( false ); clone.setUpdateable( false ); clone.setNaturalIdentifier( false ); clone.setValueGenerationStrategy( property.getValueGenerationStrategy() ); synthProp.setName( syntheticPropertyName ); synthProp.setPersistentClass( ownerEntity ); synthProp.setUpdateable( false ); synthProp.setInsertable( false ); synthProp.setValue( embeddedComp );
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 ); }
property.setUpdateable( singularAttributeSource.isUpdatable() ); mappingDocument.getOrigin() ); property.setUpdateable( false );
newProperty.setValueGenerationStrategy( current.getValueGenerationStrategy() ); newProperty.setInsertable( false ); newProperty.setUpdateable( false ); newProperty.setMetaAttributes( current.getMetaAttributes() ); newProperty.setName( current.getName() );
property.setUpdateable( false ); property.setInsertable( false ); property.setValue( mapper );
/** * 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; }
Property property = new Property(); property.setName( PropertyPath.IDENTIFIER_MAPPER_PROPERTY ); property.setUpdateable( false ); property.setInsertable( false ); property.setValue( mapper );
prop.setUpdateable( updatable );
Property clone = BinderHelper.shallowCopy( property ); clone.setInsertable( false ); clone.setUpdateable( false ); clone.setNaturalIdentifier( false ); clone.setGeneration( property.getGeneration() ); synthProp.setNodeName( syntheticPropertyName ); synthProp.setPersistentClass( ownerEntity ); synthProp.setUpdateable( false ); synthProp.setInsertable( false ); synthProp.setValue( embeddedComp );
newProperty.setGeneration( current.getGeneration() ); newProperty.setInsertable( false ); newProperty.setUpdateable( false ); newProperty.setMetaAttributes( current.getMetaAttributes() ); newProperty.setName( current.getName() );
prop.setUpdateable( updatable ); OptimisticLock lockAnn = property != null ? property.getAnnotation( OptimisticLock.class ) :
property.setName( "_identifierMapper" ); property.setNodeName( "id" ); property.setUpdateable( false ); property.setInsertable( false ); property.setValue( mapper );
/** * 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; }
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 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); }
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 ); }
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; }