Top Inners Fields Constructors Methods
org.hibernate.cfg.annotations

public Class PropertyBinder

extends Object
Class Inheritance
Imports
java.lang.annotation.Annotation, java.util.Map, javax.persistence.EmbeddedId, .Id, .Lob, org.hibernate.AnnotationException, .AssertionFailure, .HibernateException, org.hibernate.annotations.AttributeAccessor, .Generated, .Immutable, .NaturalId, .OptimisticLock, .ValueGenerationType, org.hibernate.annotations.common.reflection.XClass, .XProperty, org.hibernate.boot.spi.MetadataBuildingContext, org.hibernate.cfg.AccessType, .AnnotationBinder, .BinderHelper, .Ejb3Column, .InheritanceState, .PropertyHolder, .PropertyPreloadedData, org.hibernate.internal.CoreMessageLogger, org.hibernate.internal.util.StringHelper, org.hibernate.mapping.Collection, .Component, .KeyValue, .Property, .RootClass, .SimpleValue, .ToOne, .Value, org.hibernate.tuple.AnnotationValueGeneration, .GenerationTiming, .ValueGeneration, .ValueGenerator, org.jboss.logging.Logger

Author
Emmanuel Bernard

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private AccessType
private MetadataBuildingContext
private String
private Ejb3Column[]
private XClass
private boolean
private boolean
private EntityBinder
private PropertyHolder
private Map<XClass, InheritanceState>
private boolean
private boolean
private boolean
private boolean
private String
private static final CoreMessageLogger
private Property
private String
private XProperty
private String
private XClass
private String
private SimpleValueBinder
private boolean
private Value

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private Property
bind(Property prop)

private ValueGeneration
public SimpleValueBinder
public Value
private <A extends Annotation> AnnotationValueGeneration<A>
getValueGenerationFromAnnotation(XProperty property, A annotation)

In case the given annotation is a value generator annotation, the corresponding value generation strategy to be applied to the given property is returned, null otherwise.

private ValueGeneration
getValueGenerationFromAnnotations(XProperty property)

Returns the value generation strategy for the given property, if any.

private <A extends Annotation> AnnotationValueGeneration<A>
instantiateAndInitializeValueGeneration(A annotation, Class<? extends AnnotationValueGeneration<?>> generationType, XProperty property)

Instantiates the given generator annotation type, initializing it with the given instance of the corresponding generator annotation and the property's type.

private boolean
public Property
public Property
private Property
public Property
public void
public void
public void
setCascade(String cascadeStrategy)

public void
public void
setDeclaringClass(XClass declaringClass)

public void
setEmbedded(boolean embedded)

public void
public void
public void
setId(boolean id)

public void
public void
setInsertable(boolean insertable)

public void
setLazy(boolean lazy)

public void
setLazyGroup(String lazyGroup)

public void
public void
public void
setReferencedEntityName(String referencedEntityName)

public void
setReturnedClass(XClass returnedClass)

public void
setReturnedClassName(String returnedClassName)

public void
setUpdatable(boolean updatable)

public void
setValue(Value value)

public void
setXToMany(boolean xToMany)

private void
private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

accessTypeback to summary
private AccessType accessType
buildingContextback to summary
private MetadataBuildingContext buildingContext
cascadeback to summary
private String cascade
columnsback to summary
private Ejb3Column[] columns
declaringClassback to summary
private XClass declaringClass
declaringClassSetback to summary
private boolean declaringClassSet
embeddedback to summary
private boolean embedded
entityBinderback to summary
private EntityBinder entityBinder
holderback to summary
private PropertyHolder holder
inheritanceStatePerClassback to summary
private Map<XClass, InheritanceState> inheritanceStatePerClass
insertableback to summary
private boolean insertable
isIdback to summary
private boolean isId
isXToManyback to summary
private boolean isXToMany
lazyback to summary
private boolean lazy
lazyGroupback to summary
private String lazyGroup
LOGback to summary
private static final CoreMessageLogger LOG
mappingPropertyback to summary
private Property mappingProperty
nameback to summary
private String name
propertyback to summary
private XProperty property
referencedEntityNameback to summary
private String referencedEntityName
returnedClassback to summary
private XClass returnedClass
returnedClassNameback to summary
private String returnedClassName
simpleValueBinderback to summary
private SimpleValueBinder simpleValueBinder
updatableback to summary
private boolean updatable
valueback to summary
private Value value

Constructor Detail

PropertyBinderback to summary
public PropertyBinder()

Method Detail

bindback to summary
private Property bind(Property prop)
determineValueGenerationStrategyback to summary
private ValueGeneration determineValueGenerationStrategy(XProperty property)
getSimpleValueBinderback to summary
public SimpleValueBinder getSimpleValueBinder()
getValueback to summary
public Value getValue()
getValueGenerationFromAnnotationback to summary
private <A extends Annotation> AnnotationValueGeneration<A> getValueGenerationFromAnnotation(XProperty property, A annotation)

In case the given annotation is a value generator annotation, the corresponding value generation strategy to be applied to the given property is returned, null otherwise.

getValueGenerationFromAnnotationsback to summary
private ValueGeneration getValueGenerationFromAnnotations(XProperty property)

Returns the value generation strategy for the given property, if any.

instantiateAndInitializeValueGenerationback to summary
private <A extends Annotation> AnnotationValueGeneration<A> instantiateAndInitializeValueGeneration(A annotation, Class<? extends AnnotationValueGeneration<?>> generationType, XProperty property)

Instantiates the given generator annotation type, initializing it with the given instance of the corresponding generator annotation and the property's type.

isToOneValueback to summary
private boolean isToOneValue(Value value)
makePropertyback to summary
public Property makeProperty()
makePropertyAndBindback to summary
public Property makePropertyAndBind()
makePropertyAndValueback to summary
private Property makePropertyAndValue()
makePropertyValueAndBindback to summary
public Property makePropertyValueAndBind()
setAccessTypeback to summary
public void setAccessType(AccessType accessType)
setBuildingContextback to summary
public void setBuildingContext(MetadataBuildingContext buildingContext)
setCascadeback to summary
public void setCascade(String cascadeStrategy)
setColumnsback to summary
public void setColumns(Ejb3Column[] columns)
setDeclaringClassback to summary
public void setDeclaringClass(XClass declaringClass)
setEmbeddedback to summary
public void setEmbedded(boolean embedded)
setEntityBinderback to summary
public void setEntityBinder(EntityBinder entityBinder)
setHolderback to summary
public void setHolder(PropertyHolder holder)
setIdback to summary
public void setId(boolean id)
setInheritanceStatePerClassback to summary
public void setInheritanceStatePerClass(Map<XClass, InheritanceState> inheritanceStatePerClass)
setInsertableback to summary
public void setInsertable(boolean insertable)
setLazyback to summary
public void setLazy(boolean lazy)
setLazyGroupback to summary
public void setLazyGroup(String lazyGroup)
setNameback to summary
public void setName(String name)
setPropertyback to summary
public void setProperty(XProperty property)
setReferencedEntityNameback to summary
public void setReferencedEntityName(String referencedEntityName)
setReturnedClassback to summary
public void setReturnedClass(XClass returnedClass)
setReturnedClassNameback to summary
public void setReturnedClassName(String returnedClassName)
setUpdatableback to summary
public void setUpdatable(boolean updatable)
setValueback to summary
public void setValue(Value value)
setXToManyback to summary
public void setXToMany(boolean xToMany)
validateBindback to summary
private void validateBind()
validateMakeback to summary
private void validateMake()
org.hibernate.cfg.annotations back to summary

private Class PropertyBinder.NoValueGeneration

extends Object
implements ValueGeneration
Class Inheritance
  • java.lang.Object
  • org.hibernate.cfg.annotations.PropertyBinder.NoValueGeneration
All Implemented Interfaces
org.hibernate.tuple.ValueGeneration, java.io.Serializable

Field Summary

Modifier and TypeField and Description
public static final PropertyBinder.NoValueGeneration
INSTANCE

Singleton access

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public String
getDatabaseGeneratedReferencedColumnValue()

Implements org.hibernate.tuple.ValueGeneration.getDatabaseGeneratedReferencedColumnValue.

For values which are generated in the database (getValueGenerator == null), if the column will be referenced in the SQL (referenceColumnInSql() == true), what value should be used in the SQL as the column value.
public GenerationTiming
getGenerationTiming()

Implements org.hibernate.tuple.ValueGeneration.getGenerationTiming.

When is this value generated : NEVER, INSERT, ALWAYS (INSERT+UPDATE)
public ValueGenerator<?>
getValueGenerator()

Implements org.hibernate.tuple.ValueGeneration.getValueGenerator.

Obtain the in-VM value generator.
public boolean
referenceColumnInSql()

Implements org.hibernate.tuple.ValueGeneration.referenceColumnInSql.

For values which are generated in the database (getValueGenerator() == null), should the column be referenced in the INSERT / UPDATE SQL?
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INSTANCEback to summary
public static final PropertyBinder.NoValueGeneration INSTANCE

Singleton access

Constructor Detail

NoValueGenerationback to summary
private NoValueGeneration()

Method Detail

getDatabaseGeneratedReferencedColumnValueback to summary
public String getDatabaseGeneratedReferencedColumnValue()

Implements org.hibernate.tuple.ValueGeneration.getDatabaseGeneratedReferencedColumnValue.

Doc from org.hibernate.tuple.ValueGeneration.getDatabaseGeneratedReferencedColumnValue.

For values which are generated in the database (getValueGenerator == null), if the column will be referenced in the SQL (referenceColumnInSql() == true), what value should be used in the SQL as the column value.

Generally this will be a function call or a marker (DEFAULTS).

NOTE : for in-VM generation, this will not be called and the column value will implicitly be a JDBC parameter ('?')

Returns:String

The column value to be used in the SQL.

Annotations
@Override
getGenerationTimingback to summary
public GenerationTiming getGenerationTiming()

Implements org.hibernate.tuple.ValueGeneration.getGenerationTiming.

Doc from org.hibernate.tuple.ValueGeneration.getGenerationTiming.

When is this value generated : NEVER, INSERT, ALWAYS (INSERT+UPDATE)

Returns:GenerationTiming

When the value is generated.

Annotations
@Override
getValueGeneratorback to summary
public ValueGenerator<?> getValueGenerator()

Implements org.hibernate.tuple.ValueGeneration.getValueGenerator.

Doc from org.hibernate.tuple.ValueGeneration.getValueGenerator.

Obtain the in-VM value generator.

May return null. In fact for values that are generated "in the database" via execution of the INSERT/UPDATE statement, the expectation is that null be returned here

Returns:ValueGenerator<?>

The strategy for performing in-VM value generation

Annotations
@Override
referenceColumnInSqlback to summary
public boolean referenceColumnInSql()

Implements org.hibernate.tuple.ValueGeneration.referenceColumnInSql.

Doc from org.hibernate.tuple.ValueGeneration.referenceColumnInSql.

For values which are generated in the database (getValueGenerator() == null), should the column be referenced in the INSERT / UPDATE SQL?

This will be false most often to have a DDL-defined DEFAULT value be applied on INSERT

Returns:boolean

true indicates the column should be included in the SQL.

Annotations
@Override