ome.tools.hibernate
Class ListAsSQLArrayUserType.ENUM<E extends Enum<E>>

java.lang.Object
  extended by ome.tools.hibernate.ListAsSQLArrayUserType<E>
      extended by ome.tools.hibernate.ListAsSQLArrayUserType.ENUM<E>
All Implemented Interfaces:
org.hibernate.usertype.UserType
Enclosing class:
ListAsSQLArrayUserType<T>

public static class ListAsSQLArrayUserType.ENUM<E extends Enum<E>>
extends ListAsSQLArrayUserType<E>

Warning, this one is special. You have to define a class that extends ENUM_LIST<E> and that has a no arguments constructor. For example : class MyEnumsList extends ENUM_LIST&<MyEnumType> { public MyEnumList(){ super( MyEnum.values() ); } } Then, define : hibernate.property type="com.myPackage.MyEnumsList" hibernate.column name="fieldName" sql-type="int[]"


Nested Class Summary
 
Nested classes/interfaces inherited from class ome.tools.hibernate.ListAsSQLArrayUserType
ListAsSQLArrayUserType.BOOLEAN, ListAsSQLArrayUserType.DATE, ListAsSQLArrayUserType.DOUBLE, ListAsSQLArrayUserType.ENUM<E extends Enum<E>>, ListAsSQLArrayUserType.FLOAT, ListAsSQLArrayUserType.INTEGER, ListAsSQLArrayUserType.STRING, ListAsSQLArrayUserType.STRING2
 
Constructor Summary
protected ListAsSQLArrayUserType.ENUM(E[] theEnumValues)
           
 
Method Summary
protected  Array getDataAsArray(Object value)
           
protected  List<E> getDataFromArray(Object array)
           
 
Methods inherited from class ome.tools.hibernate.ListAsSQLArrayUserType
assemble, deepCopy, disassemble, equals, hashCode, isMutable, nullSafeGet, nullSafeSet, replace, returnedClass, sqlTypes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListAsSQLArrayUserType.ENUM

protected ListAsSQLArrayUserType.ENUM(E[] theEnumValues)
Parameters:
clazz - the class of the enum.
theEnumValues - The values of enum (by invoking .values()).
Method Detail

getDataAsArray

protected Array getDataAsArray(Object value)
Specified by:
getDataAsArray in class ListAsSQLArrayUserType<E extends Enum<E>>

getDataFromArray

protected List<E> getDataFromArray(Object array)
Specified by:
getDataFromArray in class ListAsSQLArrayUserType<E extends Enum<E>>


OmeroJava Api

Version: Beta-4.2.0-r7571-b29

Copyright © 2009 The University of Dundee. All Rights Reserved.