|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.hibernate.type.AbstractType
org.hibernate.type.EntityType
org.hibernate.type.OneToOneType
org.hibernate.type.SpecialOneToOneType
public class SpecialOneToOneType
A one-to-one association that maps to specific formula(s) instead of the primary key column of the owning entity.
| Field Summary |
|---|
| Fields inherited from class org.hibernate.type.EntityType |
|---|
isEmbeddedInXML, uniqueKeyPropertyName |
| Fields inherited from class org.hibernate.type.AbstractType |
|---|
LEGACY_DEFAULT_SIZE, LEGACY_DICTATED_SIZE |
| Constructor Summary | |
|---|---|
SpecialOneToOneType(TypeFactory.TypeScope scope,
String referencedEntityName,
ForeignKeyDirection foreignKeyType,
String uniqueKeyPropertyName,
boolean lazy,
boolean unwrapProxy,
String entityName,
String propertyName)
|
|
| Method Summary | |
|---|---|
Object |
assemble(Serializable oid,
SessionImplementor session,
Object owner)
Reconstruct the object from its disassembled state. |
Size[] |
defaultSizes(Mapping mapping)
Defines the column sizes to use according to this type if the user did not explicitly say (and if no Type.dictatedSizes(org.hibernate.engine.spi.Mapping) were given). |
Size[] |
dictatedSizes(Mapping mapping)
Return the column sizes dictated by this type. |
Serializable |
disassemble(Object value,
SessionImplementor session,
Object owner)
Return a disassembled representation of the object. |
int |
getColumnSpan(Mapping mapping)
How many columns are used to persist this type. |
Object |
hydrate(ResultSet rs,
String[] names,
SessionImplementor session,
Object owner)
Extract a value from the JDBC result set. |
int[] |
sqlTypes(Mapping mapping)
Return the JDBC types codes (per Types) for the columns mapped by this type. |
boolean |
useLHSPrimaryKey()
Is the primary key of the owning entity table to be used in the join? |
| Methods inherited from class org.hibernate.type.OneToOneType |
|---|
getForeignKeyDirection, getPropertyName, isAlwaysDirtyChecked, isDirty, isDirty, isModified, isNull, isNullable, isOneToOne, nullSafeSet, nullSafeSet, toColumnNullness |
| Methods inherited from class org.hibernate.type.AbstractType |
|---|
beforeAssemble, getHashCode, isAnyType, isCollectionType, isComponentType, isEqual, replace, replaceNode, semiResolve |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.hibernate.type.Type |
|---|
beforeAssemble, getHashCode, isAnyType, isCollectionType, isComponentType, isEqual, replace, semiResolve |
| Constructor Detail |
|---|
public SpecialOneToOneType(TypeFactory.TypeScope scope,
String referencedEntityName,
ForeignKeyDirection foreignKeyType,
String uniqueKeyPropertyName,
boolean lazy,
boolean unwrapProxy,
String entityName,
String propertyName)
| Method Detail |
|---|
public int getColumnSpan(Mapping mapping)
throws MappingException
TypesqlTypes(mapping).length
getColumnSpan in interface TypegetColumnSpan in class OneToOneTypemapping - The mapping object :/
MappingException - Generally indicates an issue accessing the passed mapping object.
public int[] sqlTypes(Mapping mapping)
throws MappingException
TypeTypes) for the columns mapped by this type.
NOTE: The number of elements in this array matches the return from Type.getColumnSpan(org.hibernate.engine.spi.Mapping).
sqlTypes in interface TypesqlTypes in class OneToOneTypemapping - The mapping object :/
MappingException - Generally indicates an issue accessing the passed mapping object.
public Size[] dictatedSizes(Mapping mapping)
throws MappingException
Typechar/Character would
have a dictated length limit of 1; for a string-based UUID would have a size limit of 36; etc.
NOTE: The number of elements in this array matches the return from Type.getColumnSpan(org.hibernate.engine.spi.Mapping).
dictatedSizes in interface TypedictatedSizes in class OneToOneTypemapping - The mapping object :/
MappingException - Generally indicates an issue accessing the passed mapping object.
public Size[] defaultSizes(Mapping mapping)
throws MappingException
TypeType.dictatedSizes(org.hibernate.engine.spi.Mapping) were given).
NOTE: The number of elements in this array matches the return from Type.getColumnSpan(org.hibernate.engine.spi.Mapping).
defaultSizes in interface TypedefaultSizes in class OneToOneTypemapping - The mapping object :/
MappingException - Generally indicates an issue accessing the passed mapping object.public boolean useLHSPrimaryKey()
AssociationType
useLHSPrimaryKey in interface AssociationTypeuseLHSPrimaryKey in class OneToOneType
public Object hydrate(ResultSet rs,
String[] names,
SessionImplementor session,
Object owner)
throws HibernateException,
SQLException
TypeType.resolve(java.lang.Object, org.hibernate.engine.spi.SessionImplementor, java.lang.Object)
This hydrated value will be either:
hydrate in interface Typehydrate in class OneToOneTypers - The JDBC result setnames - the column names making up this type value (use to read from result set)session - The originating sessionowner - the parent entity
HibernateException - An error from Hibernate
SQLException - An error from the JDBC driverType.resolve(java.lang.Object, org.hibernate.engine.spi.SessionImplementor, java.lang.Object)
public Serializable disassemble(Object value,
SessionImplementor session,
Object owner)
throws HibernateException
Type
disassemble in interface Typedisassemble in class OneToOneTypevalue - the value to cachesession - the originating sessionowner - optional parent entity object (needed for collections)
HibernateException - An error from Hibernate
public Object assemble(Serializable oid,
SessionImplementor session,
Object owner)
throws HibernateException
TypeType.disassemble(java.lang.Object, org.hibernate.engine.spi.SessionImplementor, java.lang.Object)
assemble in interface Typeassemble in class OneToOneTypeoid - the disassembled state from the cachesession - the originating sessionowner - the parent entity object
HibernateException - An error from Hibernate
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||