org.hibernate.ogm.type
Class OneToOneType

java.lang.Object
  extended by org.hibernate.ogm.type.GridTypeDelegatingToCoreType
      extended by org.hibernate.ogm.type.OneToOneType
All Implemented Interfaces:
Serializable, GridType

public class OneToOneType
extends GridTypeDelegatingToCoreType
implements GridType

Author:
Emmanuel Bernard
See Also:
Serialized Form

Method Summary
 Object hydrate(Map<String,Object> rs, String[] names, SessionImplementor session, Object owner)
          Retrieve an instance of the mapped class, or the identifier of an entity or collection, from a grid resultset.
 Object nullSafeGet(Map<String,Object> rs, String[] names, SessionImplementor session, Object owner)
          Retrieve an instance of the mapped class from a grid resultset.
 Object nullSafeGet(Map<String,Object> rs, String name, SessionImplementor session, Object owner)
          Retrieve an instance of the mapped class from a grid resultset.
 void nullSafeSet(Map<String,Object> resultset, Object value, String[] names, boolean[] settable, SessionImplementor session)
          Write an instance of the mapped class to a prepared statement, ignoring some columns.
 void nullSafeSet(Map<String,Object> resultset, Object value, String[] names, SessionImplementor session)
          Write an instance of the mapped class to a prepared statement.
 
Methods inherited from class org.hibernate.ogm.type.GridTypeDelegatingToCoreType
assemble, beforeAssemble, compare, deepCopy, disassemble, fromXMLNode, getColumnSpan, getHashCode, getHashCode, getName, getReturnedClass, getSemiResolvedType, isAnyType, isAssociationType, isCollectionType, isComponentType, isDirty, isDirty, isEntityType, isEqual, isEqual, isModified, isMutable, isSame, isXMLElement, replace, replace, resolve, semiResolve, setToXMLNode, toColumnNullness, toLoggableString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.hibernate.ogm.type.GridType
assemble, beforeAssemble, compare, deepCopy, disassemble, fromXMLNode, getColumnSpan, getHashCode, getHashCode, getName, getReturnedClass, getSemiResolvedType, isAnyType, isAssociationType, isCollectionType, isComponentType, isDirty, isDirty, isEntityType, isEqual, isEqual, isModified, isMutable, isSame, isXMLElement, replace, replace, resolve, semiResolve, setToXMLNode, toColumnNullness, toLoggableString
 

Method Detail

nullSafeGet

public Object nullSafeGet(Map<String,Object> rs,
                          String[] names,
                          SessionImplementor session,
                          Object owner)
                   throws HibernateException
Description copied from interface: GridType
Retrieve an instance of the mapped class from a grid resultset. Implementors should handle possibility of null values.

Specified by:
nullSafeGet in interface GridType
names - the column names
owner - the parent entity
Returns:
Object
Throws:
HibernateException
See Also:
alternative, 2-phase property initialization

nullSafeGet

public Object nullSafeGet(Map<String,Object> rs,
                          String name,
                          SessionImplementor session,
                          Object owner)
                   throws HibernateException
Description copied from interface: GridType
Retrieve an instance of the mapped class from a grid resultset. Implementations should handle possibility of null values. This method might be called if the type is known to be a single-column type.

Specified by:
nullSafeGet in interface GridType
name - the column name
owner - the parent entity
Returns:
Object
Throws:
HibernateException

nullSafeSet

public void nullSafeSet(Map<String,Object> resultset,
                        Object value,
                        String[] names,
                        boolean[] settable,
                        SessionImplementor session)
                 throws HibernateException
Description copied from interface: GridType
Write an instance of the mapped class to a prepared statement, ignoring some columns. Implementors should handle possibility of null values. A multi-column type should be written to parameters starting from index.

Specified by:
nullSafeSet in interface GridType
Parameters:
resultset - to push value into
value - the object to write
settable - an array indicating which columns to ignore
Throws:
HibernateException

nullSafeSet

public void nullSafeSet(Map<String,Object> resultset,
                        Object value,
                        String[] names,
                        SessionImplementor session)
                 throws HibernateException
Description copied from interface: GridType
Write an instance of the mapped class to a prepared statement. Implementors should handle possibility of null values. A multi-column type should be written to parameters starting from index.

Specified by:
nullSafeSet in interface GridType
Parameters:
resultset - to push value into
value - the object to write
Throws:
HibernateException

hydrate

public Object hydrate(Map<String,Object> rs,
                      String[] names,
                      SessionImplementor session,
                      Object owner)
               throws HibernateException
Description copied from interface: GridType
Retrieve an instance of the mapped class, or the identifier of an entity or collection, from a grid resultset. This is useful for 2-phase property initialization - the second phase is a call to resolveIdentifier().

Specified by:
hydrate in interface GridType
names - the column names
session - the session
owner - the parent entity
Returns:
Object an identifier or actual value
Throws:
HibernateException
See Also:
Type#resolve(Object, SessionImplementor, Object)


Copyright © 2010-2011 Red Hat Middleware, LLC, Emmanuel Bernard and various contributors. All Rights Reserved