org.hibernate.cfg
Class Ejb3JoinColumn

java.lang.Object
  extended by org.hibernate.cfg.Ejb3Column
      extended by org.hibernate.cfg.Ejb3JoinColumn

public class Ejb3JoinColumn
extends Ejb3Column

Wrap state of an EJB3 @JoinColumn annotation and build the Hibernate column mapping element


Field Summary
static int NO_REFERENCE
           
static int NON_PK_REFERENCE
           
static int PK_REFERENCE
           
 
Fields inherited from class org.hibernate.cfg.Ejb3Column
DEFAULT_COLUMN_LENGTH, joins, propertyHolder, sqlType
 
Method Summary
protected  void addColumnBinding(SimpleValue value)
           
 void addDefaultJoinColumnName(PersistentClass referencedEntity, String logicalReferencedColumn)
           
static Ejb3JoinColumn buildJoinColumn(PrimaryKeyJoinColumn pkJoinAnn, JoinColumn joinAnn, Value identifier, Map<String,Join> joins, PropertyHolder propertyHolder, Mappings mappings)
          Build JoinColumn for a JOINED hierarchy
static Ejb3JoinColumn[] buildJoinColumns(JoinColumn[] anns, String mappedBy, Map<String,Join> joins, PropertyHolder propertyHolder, String propertyName, Mappings mappings)
           
static Ejb3JoinColumn[] buildJoinColumnsOrFormulas(JoinColumnsOrFormulas anns, String mappedBy, Map<String,Join> joins, PropertyHolder propertyHolder, String propertyName, Mappings mappings)
           
static Ejb3JoinColumn[] buildJoinColumnsWithDefaultColumnSuffix(JoinColumn[] anns, String mappedBy, Map<String,Join> joins, PropertyHolder propertyHolder, String propertyName, String suffixForDefaultColumnName, Mappings mappings)
           
static Ejb3JoinColumn buildJoinFormula(JoinFormula ann, String mappedBy, Map<String,Join> joins, PropertyHolder propertyHolder, String propertyName, Mappings mappings)
          build join formula
static Ejb3JoinColumn[] buildJoinTableJoinColumns(JoinColumn[] annJoins, Map<String,Join> secondaryTables, PropertyHolder propertyHolder, String propertyName, String mappedBy, Mappings mappings)
           
static void checkIfJoinColumn(Object columns, PropertyHolder holder, PropertyData property)
           
static int checkReferencedColumnsType(Ejb3JoinColumn[] columns, PersistentClass referencedEntity, Mappings mappings)
           
 void copyReferencedStructureAndCreateDefaultJoinColumns(PersistentClass referencedEntity, Iterator columnIterator, SimpleValue value)
           
 String getManyToManyOwnerSideEntityName()
           
 String getMappedBy()
           
 String getReferencedColumn()
           
 void linkValueUsingAColumnCopy(Column column, SimpleValue value)
          used for mappedBy cases
 void linkValueUsingDefaultColumnNaming(Column referencedColumn, PersistentClass referencedEntity, SimpleValue value)
           
 void overrideFromReferencedColumnIfNecessary(Column column)
          Called to apply column definitions from the referenced FK column to this column.
 void redefineColumnName(String columnName, String propertyName, boolean applyNamingStrategy)
           
 void setJoinAnnotation(JoinColumn annJoin, String defaultName)
           
 void setJPA2ElementCollection(boolean JPA2ElementCollection)
           
 void setManyToManyOwnerSideEntityName(String manyToManyOwnerSideEntityName)
           
 void setMappedBy(String mappedBy)
           
 void setMappedBy(String entityName, String logicalTableName, String mappedByProperty)
           
 void setPersistentClass(PersistentClass persistentClass, Map<String,Join> joins, Map<org.hibernate.annotations.common.reflection.XClass,InheritanceState> inheritanceStatePerClass)
          Override persistent class on oneToMany Cases for late settings Must only be used on second level pass binding
 void setReferencedColumn(String referencedColumn)
           
 String toString()
           
 
Methods inherited from class org.hibernate.cfg.Ejb3Column
addIndex, bind, buildColumnFromAnnotation, buildColumnFromAnnotation, checkPropertyConsistency, forceNotNull, getFormulaString, getJoin, getLength, getLogicalColumnName, getMappingColumn, getMappings, getName, getPrecision, getPropertyHolder, getPropertyName, getScale, getSecondaryTableName, getSqlType, getTable, initMappingColumn, isFormula, isImplicit, isInsertable, isNameDeferred, isNullable, isSecondary, isUnique, isUpdatable, linkWithValue, setFormula, setImplicit, setInsertable, setJoins, setLength, setLogicalColumnName, setMappingColumn, setMappings, setNullable, setPrecision, setPropertyHolder, setPropertyName, setScale, setSecondaryTableName, setSqlType, setTable, setUnique, setUpdatable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NO_REFERENCE

public static final int NO_REFERENCE
See Also:
Constant Field Values

PK_REFERENCE

public static final int PK_REFERENCE
See Also:
Constant Field Values

NON_PK_REFERENCE

public static final int NON_PK_REFERENCE
See Also:
Constant Field Values
Method Detail

setJPA2ElementCollection

public void setJPA2ElementCollection(boolean JPA2ElementCollection)

getManyToManyOwnerSideEntityName

public String getManyToManyOwnerSideEntityName()

setManyToManyOwnerSideEntityName

public void setManyToManyOwnerSideEntityName(String manyToManyOwnerSideEntityName)

setReferencedColumn

public void setReferencedColumn(String referencedColumn)

getMappedBy

public String getMappedBy()

setMappedBy

public void setMappedBy(String mappedBy)

getReferencedColumn

public String getReferencedColumn()

buildJoinColumnsOrFormulas

public static Ejb3JoinColumn[] buildJoinColumnsOrFormulas(JoinColumnsOrFormulas anns,
                                                          String mappedBy,
                                                          Map<String,Join> joins,
                                                          PropertyHolder propertyHolder,
                                                          String propertyName,
                                                          Mappings mappings)

buildJoinFormula

public static Ejb3JoinColumn buildJoinFormula(JoinFormula ann,
                                              String mappedBy,
                                              Map<String,Join> joins,
                                              PropertyHolder propertyHolder,
                                              String propertyName,
                                              Mappings mappings)
build join formula


buildJoinColumns

public static Ejb3JoinColumn[] buildJoinColumns(JoinColumn[] anns,
                                                String mappedBy,
                                                Map<String,Join> joins,
                                                PropertyHolder propertyHolder,
                                                String propertyName,
                                                Mappings mappings)

buildJoinColumnsWithDefaultColumnSuffix

public static Ejb3JoinColumn[] buildJoinColumnsWithDefaultColumnSuffix(JoinColumn[] anns,
                                                                       String mappedBy,
                                                                       Map<String,Join> joins,
                                                                       PropertyHolder propertyHolder,
                                                                       String propertyName,
                                                                       String suffixForDefaultColumnName,
                                                                       Mappings mappings)

setJoinAnnotation

public void setJoinAnnotation(JoinColumn annJoin,
                              String defaultName)

buildJoinColumn

public static Ejb3JoinColumn buildJoinColumn(PrimaryKeyJoinColumn pkJoinAnn,
                                             JoinColumn joinAnn,
                                             Value identifier,
                                             Map<String,Join> joins,
                                             PropertyHolder propertyHolder,
                                             Mappings mappings)
Build JoinColumn for a JOINED hierarchy


setPersistentClass

public void setPersistentClass(PersistentClass persistentClass,
                               Map<String,Join> joins,
                               Map<org.hibernate.annotations.common.reflection.XClass,InheritanceState> inheritanceStatePerClass)
Override persistent class on oneToMany Cases for late settings Must only be used on second level pass binding


checkIfJoinColumn

public static void checkIfJoinColumn(Object columns,
                                     PropertyHolder holder,
                                     PropertyData property)

copyReferencedStructureAndCreateDefaultJoinColumns

public void copyReferencedStructureAndCreateDefaultJoinColumns(PersistentClass referencedEntity,
                                                               Iterator columnIterator,
                                                               SimpleValue value)

linkValueUsingDefaultColumnNaming

public void linkValueUsingDefaultColumnNaming(Column referencedColumn,
                                              PersistentClass referencedEntity,
                                              SimpleValue value)

addDefaultJoinColumnName

public void addDefaultJoinColumnName(PersistentClass referencedEntity,
                                     String logicalReferencedColumn)

linkValueUsingAColumnCopy

public void linkValueUsingAColumnCopy(Column column,
                                      SimpleValue value)
used for mappedBy cases


addColumnBinding

protected void addColumnBinding(SimpleValue value)
Overrides:
addColumnBinding in class Ejb3Column

checkReferencedColumnsType

public static int checkReferencedColumnsType(Ejb3JoinColumn[] columns,
                                             PersistentClass referencedEntity,
                                             Mappings mappings)

overrideFromReferencedColumnIfNecessary

public void overrideFromReferencedColumnIfNecessary(Column column)
Called to apply column definitions from the referenced FK column to this column.

Parameters:
column - the referenced column.

redefineColumnName

public void redefineColumnName(String columnName,
                               String propertyName,
                               boolean applyNamingStrategy)
Overrides:
redefineColumnName in class Ejb3Column

buildJoinTableJoinColumns

public static Ejb3JoinColumn[] buildJoinTableJoinColumns(JoinColumn[] annJoins,
                                                         Map<String,Join> secondaryTables,
                                                         PropertyHolder propertyHolder,
                                                         String propertyName,
                                                         String mappedBy,
                                                         Mappings mappings)

setMappedBy

public void setMappedBy(String entityName,
                        String logicalTableName,
                        String mappedByProperty)

toString

public String toString()
Overrides:
toString in class Ejb3Column


Copyright © 2001-2012 Red Hat, Inc. All Rights Reserved.