buildingContext ); rootClass.setIdentifier( identifier ); identifier.setNullValue( "undefined" ); rootClass.setEmbeddedIdentifier( true ); rootClass.setIdentifier( ( KeyValue ) getValue() ); if (embedded) { rootClass.setEmbeddedIdentifier( true );
rootEntityDescriptor.setIdentifier( cid );
rootEntityDescriptor.getTable() ); rootEntityDescriptor.setIdentifier( idValue );
rootEntityDescriptor.setIdentifier( cid );
id = value.make(); rootClass.setIdentifier( id ); if ( isGlobalGeneratorNameGlobal( buildingContext ) ) { SecondPass secondPass = new IdGeneratorResolverSecondPass(
if (identifier == null) { identifier = AnnotationBinder.createComponent( holder, new PropertyPreloadedData(null, null, null), true, false, mappings ); rootClass.setIdentifier( identifier ); identifier.setNullValue( "undefined" ); rootClass.setEmbeddedIdentifier( true ); rootClass.setIdentifier( ( KeyValue ) getValue() ); if (embedded) { rootClass.setEmbeddedIdentifier( true );
protected void bindCompositeId(PersistentEntity domainClass, RootClass root, CompositeIdentity compositeIdentity, Mappings mappings, String sessionFactoryBeanName) { HibernatePersistentEntity hibernatePersistentEntity = (HibernatePersistentEntity) domainClass; Component id = new Component(mappings, root); id.setNullValue("undefined"); root.setIdentifier(id); root.setEmbeddedIdentifier(true); id.setComponentClassName(domainClass.getName()); id.setKey(true); id.setEmbedded(true); String path = qualify(root.getEntityName(), "id"); id.setRoleName(path); final PersistentProperty[] composite = hibernatePersistentEntity.getCompositeIdentity(); for (PersistentProperty property : composite) { if (property == null) { throw new MappingException("Property referenced in composite-id mapping of class [" + domainClass.getName() + "] is not a valid property!"); } bindComponentProperty(id, null, property, root, "", root.getTable(), mappings, sessionFactoryBeanName); } }
if (identifier == null) { identifier = AnnotationBinder.createComponent( holder, new PropertyPreloadedData(null, null, null), true, false ); rootClass.setIdentifier( identifier ); identifier.setNullValue( "undefined" ); rootClass.setEmbeddedIdentifier( true ); rootClass.setIdentifier( ( KeyValue ) getValue() ); if (embedded) { rootClass.setEmbeddedIdentifier( true );
private static void bindCompositeId(GrailsDomainClass domainClass, RootClass root, CompositeIdentity compositeIdentity, Mappings mappings, String sessionFactoryBeanName) { Component id = new Component(mappings, root); id.setNullValue("undefined"); root.setIdentifier(id); root.setEmbeddedIdentifier(true); id.setComponentClassName(domainClass.getFullName()); id.setKey(true); id.setEmbedded(true); String path = StringHelper.qualify(root.getEntityName(), "id"); id.setRoleName(path); String[] props = compositeIdentity.getPropertyNames(); for (String propName : props) { GrailsDomainClassProperty property = domainClass.getPropertyByName(propName); if (property == null) { throw new MappingException("Property [" + propName + "] referenced in composite-id mapping of class [" + domainClass.getFullName() + "] is not a valid property!"); } bindComponentProperty(id, null, property, root, "", root.getTable(), mappings, sessionFactoryBeanName); } }
id = value.make(); rootClass.setIdentifier( id ); BinderHelper.makeIdGenerator( id, generatorType, generatorName, mappings, localGenerators ); if ( isEmbedded ) {
rootEntityDescriptor.setIdentifier( cid );
private static void bindCompositeId(Element idNode, RootClass entity, Mappings mappings, java.util.Map inheritedMetas) throws MappingException { String propertyName = idNode.attributeValue( "name" ); Component id = new Component( mappings, entity ); entity.setIdentifier( id ); bindCompositeId( idNode, id, entity, propertyName, mappings, inheritedMetas ); if ( propertyName == null ) { entity.setEmbeddedIdentifier( id.isEmbedded() ); if ( id.isEmbedded() ) { // todo : what is the implication of this? id.setDynamic( !entity.hasPojoRepresentation() ); /* * Property prop = new Property(); prop.setName("id"); * prop.setPropertyAccessorName("embedded"); prop.setValue(id); * entity.setIdentifierProperty(prop); */ } } else { Property prop = new Property(); prop.setValue( id ); bindProperty( idNode, prop, mappings, inheritedMetas ); entity.setIdentifierProperty( prop ); } makeIdentifier( idNode, id, mappings ); }
private static void bindCompositeId(Element idNode, RootClass entity, Mappings mappings, java.util.Map inheritedMetas) throws MappingException { String propertyName = idNode.attributeValue( "name" ); Component id = new Component( entity ); entity.setIdentifier( id ); bindCompositeId( idNode, id, entity, propertyName, mappings, inheritedMetas ); if ( propertyName == null ) { entity.setEmbeddedIdentifier( id.isEmbedded() ); if ( id.isEmbedded() ) { // todo : what is the implication of this? id.setDynamic( !entity.hasPojoRepresentation() ); /* * Property prop = new Property(); prop.setName("id"); * prop.setPropertyAccessorName("embedded"); prop.setValue(id); * entity.setIdentifierProperty(prop); */ } } else { Property prop = new Property(); prop.setValue( id ); bindProperty( idNode, prop, mappings, inheritedMetas ); entity.setIdentifierProperty( prop ); } makeIdentifier( idNode, id, mappings ); }
private static void bindCompositeId(Element idNode, RootClass entity, Mappings mappings, java.util.Map inheritedMetas) throws MappingException { String propertyName = idNode.attributeValue( "name" ); Component id = new Component( mappings, entity ); entity.setIdentifier( id ); bindCompositeId( idNode, id, entity, propertyName, mappings, inheritedMetas ); if ( propertyName == null ) { entity.setEmbeddedIdentifier( id.isEmbedded() ); if ( id.isEmbedded() ) { // todo : what is the implication of this? id.setDynamic( !entity.hasPojoRepresentation() ); /* * Property prop = new Property(); prop.setName("id"); * prop.setPropertyAccessorName("embedded"); prop.setValue(id); * entity.setIdentifierProperty(prop); */ } } else { Property prop = new Property(); prop.setValue( id ); bindProperty( idNode, prop, mappings, inheritedMetas ); entity.setIdentifierProperty( prop ); } makeIdentifier( idNode, id, mappings ); }
entity.setIdentifier(id);
String propertyName = idNode.attributeValue( "name" ); Component id = new Component( entity ); entity.setIdentifier( id ); bindCompositeId( idNode, id, entity, propertyName, mappings, inheritedMetas ); if ( propertyName == null ) {
clazz.setIdentifier(id); clazz.setIdentifierProperty(prop); clazz.setDiscriminatorValue(mdTable.getQualifiedName());
clazz.setIdentifier(id); clazz.setIdentifierProperty(prop); clazz.setDiscriminatorValue(mdTable.getQualifiedName());