private Property makePropertyAndValue() { validateBind(); LOG.debugf( "MetadataSourceProcessor property %s with lazy=%s", name, lazy ); final String containerClassName = holder.getClassName(); holder.startingProperty( property ); simpleValueBinder = new SimpleValueBinder(); simpleValueBinder.setBuildingContext( buildingContext ); simpleValueBinder.setPropertyName( name ); simpleValueBinder.setReturnedClassName( returnedClassName ); simpleValueBinder.setColumns( columns ); simpleValueBinder.setPersistentClassName( containerClassName ); simpleValueBinder.setType( property, returnedClass, containerClassName, holder.resolveAttributeConverterDescriptor( property ) ); simpleValueBinder.setReferencedEntityName( referencedEntityName ); simpleValueBinder.setAccessType( accessType ); SimpleValue propertyValue = simpleValueBinder.make(); setValue( propertyValue ); return makeProperty(); }
public SimpleValue make() { validate(); LOG.debugf( "building SimpleValue for %s", propertyName ); if ( table == null ) { table = columns[0].getTable(); } simpleValue = new SimpleValue( buildingContext, table ); if ( isVersion ) { simpleValue.makeVersion(); } if ( isNationalized ) { simpleValue.makeNationalized(); } if ( isLob ) { simpleValue.makeLob(); } linkWithValue(); boolean isInSecondPass = buildingContext.getMetadataCollector().isInSecondPass(); if ( !isInSecondPass ) { //Defer this to the second pass buildingContext.getMetadataCollector().addSecondPass( new SetSimpleValueTypeSecondPass( this ) ); } else { //We are already in second pass fillSimpleValue(); } return simpleValue; }
CollectionId collectionIdAnn = property.getAnnotation( CollectionId.class ); if ( collectionIdAnn != null ) { SimpleValueBinder simpleValue = new SimpleValueBinder(); simpleValue.setTable( table ); simpleValue.setColumns( idColumns ); Type typeAnn = collectionIdAnn.type(); if ( typeAnn != null && !BinderHelper.isEmptyAnnotationValue( typeAnn.type() ) ) { simpleValue.setExplicitType( typeAnn ); + StringHelper.qualify( propertyHolder.getPath(), propertyName ) ); simpleValue.setBuildingContext( getBuildingContext() ); SimpleValue id = simpleValue.make(); ( (IdentifierCollection) collection ).setIdentifier( id ); String generator = collectionIdAnn.generator();
private Property makePropertyAndValue() { validateBind(); log.debug( "binding property {} with lazy={}", name, lazy ); String containerClassName = holder == null ? null : holder.getClassName(); simpleValueBinder = new SimpleValueBinder(); simpleValueBinder.setMappings( mappings ); simpleValueBinder.setPropertyName( name ); simpleValueBinder.setReturnedClassName( returnedClassName ); simpleValueBinder.setColumns( columns ); simpleValueBinder.setPersistentClassName( containerClassName ); simpleValueBinder.setType( property, returnedClass ); simpleValueBinder.setMappings( mappings ); simpleValueBinder.setReferencedEntityName( referencedEntityName ); SimpleValue propertyValue = simpleValueBinder.make(); setValue( propertyValue ); return makeProperty(); }
CollectionId collectionIdAnn = property.getAnnotation( CollectionId.class ); if ( collectionIdAnn != null ) { SimpleValueBinder simpleValue = new SimpleValueBinder(); simpleValue.setTable( table ); simpleValue.setColumns( idColumns ); Type typeAnn = collectionIdAnn.type(); if ( typeAnn != null && !BinderHelper.isDefault( typeAnn.type() ) ) { simpleValue.setExplicitType( typeAnn ); + StringHelper.qualify( propertyHolder.getPath(), propertyName ) ); simpleValue.setMappings( mappings ); SimpleValue id = simpleValue.make(); ( (IdentifierCollection) collection ).setIdentifier( id ); String generator = collectionIdAnn.generator();
SimpleValueBinder elementBinder = new SimpleValueBinder(); elementBinder.setMappings( mappings ); elementBinder.setReturnedClassName( mapKeyType ); column.setTable( mapValue.getCollectionTable() ); elementBinder.setColumns( elementColumns ); elementBinder.setKey(true); if (mapKeyAnn != null && ! BinderHelper.isDefault( mapKeyAnn.type().type() ) ) { elementBinder.setExplicitType( mapKeyAnn.type() ); elementBinder.setType( property, elementClass ); mapValue.setIndex( elementBinder.make() );
SimpleValueBinder elementBinder = new SimpleValueBinder(); elementBinder.setMappings( mappings ); elementBinder.setReturnedClassName( collType.getName() ); if ( elementColumns == null || elementColumns.length == 0 ) { elementColumns = new Ejb3Column[1]; column.setTable( collValue.getCollectionTable() ); elementBinder.setColumns( elementColumns ); elementBinder.setType( property, elementClass ); collValue.setElement( elementBinder.make() );
); final TemporalType temporalType = getTemporalType( property ); switch ( temporalType ) { case DATE: typeParameters.setProperty( EnumType.TABLE, columns[0].getTable().getName() ); typeParameters.setProperty( EnumType.COLUMN, columns[0].getName() ); javax.persistence.EnumType enumType = getEnumType( property ); if ( enumType != null ) { if ( javax.persistence.EnumType.ORDINAL.equals( enumType ) ) { this.typeParameters = typeParameters; Type annType = property.getAnnotation( Type.class ); setExplicitType( annType );
String type = BinderHelper.ANNOTATION_STRING_DEFAULT; if ( getDialect().supportsNationalizedTypes() ) { isNationalized = property.isAnnotationPresent( Nationalized.class ) || buildingContext.getBuildingOptions().useNationalizedCharacterData(); setExplicitType( annType ); type = explicitType; ); final TemporalType temporalType = getTemporalType( property ); switch ( temporalType ) { case DATE: this.typeParameters = typeParameters; applyAttributeConverter( property, attributeConverterDescriptor );
SimpleValueBinder value = new SimpleValueBinder(); value.setPropertyName( inferredData.getPropertyName() ); value.setReturnedClassName( inferredData.getTypeName() ); value.setColumns( columns ); value.setPersistentClassName( persistentClassName ); value.setMappings( mappings ); value.setExplicitType( typeAnn ); id = value.make();
public SimpleValue make() { validate(); log.debug( "building SimpleValue for " + propertyName ); if (table == null) { table = columns[0].getTable(); } SimpleValue simpleValue = new SimpleValue( table ); return fillSimpleValue( simpleValue ); }
public void doSecondPass(Map persistentClasses) throws MappingException { binder.fillSimpleValue(); } }
this.typeParameters = typeParameters; Type annType = (Type) property.getAnnotation( Type.class ); setExplicitType( annType );
SimpleValueBinder value = new SimpleValueBinder(); value.setPropertyName( propertyName ); value.setReturnedClassName( inferredData.getTypeName() ); value.setColumns( columns ); value.setPersistentClassName( persistentClassName ); value.setMappings( mappings ); value.setType( inferredData.getProperty(), inferredData.getClassOrElement() ); id = value.make();
if ( !list.isOneToMany() ) indexColumn.forceNotNull(); indexColumn.setPropertyHolder( valueHolder ); SimpleValueBinder value = new SimpleValueBinder(); value.setColumns( new Ejb3Column[] { indexColumn } ); value.setExplicitType( "integer" ); value.setMappings( mappings ); SimpleValue indexValue = value.make(); indexColumn.linkWithValue( indexValue ); list.setIndex( indexValue );
SimpleValueBinder elementBinder = new SimpleValueBinder(); elementBinder.setMappings( mappings ); elementBinder.setReturnedClassName( mapKeyType ); column.setTable( mapValue.getCollectionTable() ); elementBinder.setColumns( elementColumns ); elementBinder.setKey(true); MapKeyType mapKeyTypeAnnotation = property.getAnnotation( MapKeyType.class ); if ( mapKeyTypeAnnotation != null && !BinderHelper.isEmptyAnnotationValue( .type() ) ) { elementBinder.setExplicitType( mapKeyTypeAnnotation.value() ); elementBinder.setType( property, elementClass ); mapValue.setIndex( elementBinder.make() );
SimpleValueBinder elementBinder = new SimpleValueBinder(); elementBinder.setMappings( mappings ); elementBinder.setReturnedClassName( mapKeyType ); column.setTable( mapValue.getCollectionTable() ); elementBinder.setColumns( elementColumns ); elementBinder.setType( property, elementClass ); mapValue.setIndex( elementBinder.make() );
); final TemporalType temporalType = getTemporalType( property ); switch ( temporalType ) { case DATE: typeParameters.setProperty( EnumType.TABLE, columns[0].getTable().getName() ); typeParameters.setProperty( EnumType.COLUMN, columns[0].getName() ); javax.persistence.EnumType enumType = getEnumType( property ); if ( enumType != null ) { if ( javax.persistence.EnumType.ORDINAL.equals( enumType ) ) { this.typeParameters = typeParameters; Type annType = property.getAnnotation( Type.class ); setExplicitType( annType );
public void doSecondPass(Map persistentClasses) throws MappingException { binder.fillSimpleValue(); }
private Property makePropertyAndValue() { validateBind(); LOG.debugf( "MetadataSourceProcessor property %s with lazy=%s", name, lazy ); String containerClassName = holder == null ? null : holder.getClassName(); simpleValueBinder = new SimpleValueBinder(); simpleValueBinder.setMappings( mappings ); simpleValueBinder.setPropertyName( name ); simpleValueBinder.setReturnedClassName( returnedClassName ); simpleValueBinder.setColumns( columns ); simpleValueBinder.setPersistentClassName( containerClassName ); simpleValueBinder.setType( property, returnedClass ); simpleValueBinder.setMappings( mappings ); simpleValueBinder.setReferencedEntityName( referencedEntityName ); SimpleValue propertyValue = simpleValueBinder.make(); setValue( propertyValue ); return makeProperty(); }