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.ParameterizedType
Hibernate type to store Lists of primitives using SQL ARRAY.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ListAsSQLArrayUserType.ArrayFactory
static class
ListAsSQLArrayUserType.BOOLEAN
To use, define : hibernate.property type="ome.tools.hibernate.ListAsSQLArrayUserType$BOOLEAN" hibernate.column name="fieldName" sql-type="bool[]"static class
ListAsSQLArrayUserType.DATE
To use, define : hibernate.property type="ome.tools.hibernate.ListAsSQLArrayUserType$DATE" hibernate.column name="fieldName" sql-type="timestamp[]"static class
ListAsSQLArrayUserType.DOUBLE
To use, define : hibernate.property type="ome.tools.hibernate.ListAsSQLArrayUserType$DOUBLE" hibernate.column name="fieldName" sql-type="float8[]"static class
ListAsSQLArrayUserType.ENUM<E extends java.lang.Enum<E>>
Warning, this one is special.static class
ListAsSQLArrayUserType.FLOAT
To use, define : hibernate.property type="ome.tools.hibernate.ListAsSQLArrayUserType$FLOAT" hibernate.column name="fieldName" sql-type="real[]"static class
ListAsSQLArrayUserType.INTEGER
To use, define : hibernate.property type="ome.tools.hibernate.ListAsSQLArrayUserType$INTEGER" hibernate.column name="fieldName" sql-type="int[]"static class
ListAsSQLArrayUserType.STRING
To use, define : hibernate.property type="ome.tools.hibernate.ListAsSQLArrayUserType$STRING" hibernate.column name="fieldName" sql-type="text[]"static class
ListAsSQLArrayUserType.STRING2
To 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.ArrayFactory
factory
-
Constructor Summary
Constructors Constructor Description ListAsSQLArrayUserType()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.Object
assemble(java.io.Serializable cached, java.lang.Object owner)
java.lang.Object
deepCopy(java.lang.Object value)
java.io.Serializable
disassemble(java.lang.Object value)
boolean
equals(java.lang.Object x, java.lang.Object y)
protected abstract java.sql.Array
getDataAsArray(java.sql.Connection conn, java.lang.Object value)
protected abstract java.util.List<T>
getDataFromArray(java.lang.Object primitivesArray)
int
hashCode(java.lang.Object x)
boolean
isMutable()
java.lang.Object
nullSafeGet(java.sql.ResultSet resultSet, java.lang.String[] names, java.lang.Object owner)
void
nullSafeSet(java.sql.PreparedStatement preparedStatement, java.lang.Object value, int index)
java.lang.Object
replace(java.lang.Object original, java.lang.Object target, java.lang.Object owner)
java.lang.Class
returnedClass()
void
setParameterValues(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:
setParameterValues
in 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:
returnedClass
in interfaceorg.hibernate.usertype.UserType
-
sqlTypes
public int[] sqlTypes()
- Specified by:
sqlTypes
in interfaceorg.hibernate.usertype.UserType
-
deepCopy
public java.lang.Object deepCopy(java.lang.Object value)
- Specified by:
deepCopy
in interfaceorg.hibernate.usertype.UserType
-
isMutable
public boolean isMutable()
- Specified by:
isMutable
in 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:
nullSafeGet
in interfaceorg.hibernate.usertype.UserType
- Throws:
org.hibernate.HibernateException
java.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:
nullSafeSet
in interfaceorg.hibernate.usertype.UserType
- Throws:
org.hibernate.HibernateException
java.sql.SQLException
-
hashCode
public int hashCode(java.lang.Object x) throws org.hibernate.HibernateException
- Specified by:
hashCode
in 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:
equals
in 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:
assemble
in interfaceorg.hibernate.usertype.UserType
- Throws:
org.hibernate.HibernateException
-
disassemble
public java.io.Serializable disassemble(java.lang.Object value) throws org.hibernate.HibernateException
- Specified by:
disassemble
in 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:
replace
in interfaceorg.hibernate.usertype.UserType
- Throws:
org.hibernate.HibernateException
-
-