Package ome.tools.hibernate
Class ListAsSQLArrayUserType<T>
- java.lang.Object
-
- ome.tools.hibernate.ListAsSQLArrayUserType<T>
-
- All Implemented Interfaces:
org.hibernate.usertype.ParameterizedType,org.hibernate.usertype.UserType
- Direct Known Subclasses:
ListAsSQLArrayUserType.BOOLEAN,ListAsSQLArrayUserType.DATE,ListAsSQLArrayUserType.DOUBLE,ListAsSQLArrayUserType.ENUM,ListAsSQLArrayUserType.FLOAT,ListAsSQLArrayUserType.INTEGER,ListAsSQLArrayUserType.STRING,ListAsSQLArrayUserType.STRING2
public abstract class ListAsSQLArrayUserType<T> extends java.lang.Object implements org.hibernate.usertype.UserType, org.hibernate.usertype.ParameterizedTypeHibernate type to store Lists of primitives using SQL ARRAY.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceListAsSQLArrayUserType.ArrayFactorystatic classListAsSQLArrayUserType.BOOLEANTo use, define : hibernate.property type="ome.tools.hibernate.ListAsSQLArrayUserType$BOOLEAN" hibernate.column name="fieldName" sql-type="bool[]"static classListAsSQLArrayUserType.DATETo use, define : hibernate.property type="ome.tools.hibernate.ListAsSQLArrayUserType$DATE" hibernate.column name="fieldName" sql-type="timestamp[]"static classListAsSQLArrayUserType.DOUBLETo use, define : hibernate.property type="ome.tools.hibernate.ListAsSQLArrayUserType$DOUBLE" hibernate.column name="fieldName" sql-type="float8[]"static classListAsSQLArrayUserType.ENUM<E extends java.lang.Enum<E>>Warning, this one is special.static classListAsSQLArrayUserType.FLOATTo use, define : hibernate.property type="ome.tools.hibernate.ListAsSQLArrayUserType$FLOAT" hibernate.column name="fieldName" sql-type="real[]"static classListAsSQLArrayUserType.INTEGERTo use, define : hibernate.property type="ome.tools.hibernate.ListAsSQLArrayUserType$INTEGER" hibernate.column name="fieldName" sql-type="int[]"static classListAsSQLArrayUserType.STRINGTo use, define : hibernate.property type="ome.tools.hibernate.ListAsSQLArrayUserType$STRING" hibernate.column name="fieldName" sql-type="text[]"static classListAsSQLArrayUserType.STRING2To use, define : hibernate.property type="ome.tools.hibernate.ListAsSQLArrayUserType$STRING2" hibernate.column name="fieldName" sql-type="text[]" Added by Josh
-
Field Summary
Fields Modifier and Type Field Description protected ListAsSQLArrayUserType.ArrayFactoryfactory
-
Constructor Summary
Constructors Constructor Description ListAsSQLArrayUserType()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.Objectassemble(java.io.Serializable cached, java.lang.Object owner)java.lang.ObjectdeepCopy(java.lang.Object value)java.io.Serializabledisassemble(java.lang.Object value)booleanequals(java.lang.Object x, java.lang.Object y)protected abstract java.sql.ArraygetDataAsArray(java.sql.Connection conn, java.lang.Object value)protected abstract java.util.List<T>getDataFromArray(java.lang.Object primitivesArray)inthashCode(java.lang.Object x)booleanisMutable()java.lang.ObjectnullSafeGet(java.sql.ResultSet resultSet, java.lang.String[] names, java.lang.Object owner)voidnullSafeSet(java.sql.PreparedStatement preparedStatement, java.lang.Object value, int index)java.lang.Objectreplace(java.lang.Object original, java.lang.Object target, java.lang.Object owner)java.lang.ClassreturnedClass()voidsetParameterValues(java.util.Properties parameters)int[]sqlTypes()
-
-
-
Field Detail
-
factory
protected ListAsSQLArrayUserType.ArrayFactory factory
-
-
Method Detail
-
setParameterValues
public void setParameterValues(java.util.Properties parameters)
- Specified by:
setParameterValuesin interfaceorg.hibernate.usertype.ParameterizedType
-
getDataAsArray
protected abstract java.sql.Array getDataAsArray(java.sql.Connection conn, java.lang.Object value) throws java.sql.SQLException- Throws:
java.sql.SQLException
-
getDataFromArray
protected abstract java.util.List<T> getDataFromArray(java.lang.Object primitivesArray)
-
returnedClass
public java.lang.Class returnedClass()
- Specified by:
returnedClassin interfaceorg.hibernate.usertype.UserType
-
sqlTypes
public int[] sqlTypes()
- Specified by:
sqlTypesin interfaceorg.hibernate.usertype.UserType
-
deepCopy
public java.lang.Object deepCopy(java.lang.Object value)
- Specified by:
deepCopyin interfaceorg.hibernate.usertype.UserType
-
isMutable
public boolean isMutable()
- Specified by:
isMutablein interfaceorg.hibernate.usertype.UserType
-
nullSafeGet
public java.lang.Object nullSafeGet(java.sql.ResultSet resultSet, java.lang.String[] names, java.lang.Object owner) throws org.hibernate.HibernateException, java.sql.SQLException- Specified by:
nullSafeGetin interfaceorg.hibernate.usertype.UserType- Throws:
org.hibernate.HibernateExceptionjava.sql.SQLException
-
nullSafeSet
public void nullSafeSet(java.sql.PreparedStatement preparedStatement, java.lang.Object value, int index) throws org.hibernate.HibernateException, java.sql.SQLException- Specified by:
nullSafeSetin interfaceorg.hibernate.usertype.UserType- Throws:
org.hibernate.HibernateExceptionjava.sql.SQLException
-
hashCode
public int hashCode(java.lang.Object x) throws org.hibernate.HibernateException- Specified by:
hashCodein interfaceorg.hibernate.usertype.UserType- Throws:
org.hibernate.HibernateException
-
equals
public boolean equals(java.lang.Object x, java.lang.Object y) throws org.hibernate.HibernateException- Specified by:
equalsin interfaceorg.hibernate.usertype.UserType- Throws:
org.hibernate.HibernateException
-
assemble
public java.lang.Object assemble(java.io.Serializable cached, java.lang.Object owner) throws org.hibernate.HibernateException- Specified by:
assemblein interfaceorg.hibernate.usertype.UserType- Throws:
org.hibernate.HibernateException
-
disassemble
public java.io.Serializable disassemble(java.lang.Object value) throws org.hibernate.HibernateException- Specified by:
disassemblein interfaceorg.hibernate.usertype.UserType- Throws:
org.hibernate.HibernateException
-
replace
public java.lang.Object replace(java.lang.Object original, java.lang.Object target, java.lang.Object owner) throws org.hibernate.HibernateException- Specified by:
replacein interfaceorg.hibernate.usertype.UserType- Throws:
org.hibernate.HibernateException
-
-