[Building Sakai] Hibernate UserType in kernel/kernel-private

Earle Nietzel earle.nietzel at gmail.com
Thu Mar 3 12:48:50 PST 2011


Very useful :)

+1

On Thu, Mar 3, 2011 at 10:55 AM, Duffy Gillman <duffy at rsmart.com> wrote:

> I'd like to move a class from jobscheduler to kernel/kernel-private because
> it has general utility to tools using Hibernate. The class is called
> EnumUserType and is an implementation of the code found here:
>
>
> http://community.jboss.org/wiki/UserTypeforpersistinganEnumwithaVARCHARcolumn
>
> This class is useful for persisting Enum value types using Hibernate.
> EnumUserType uses generics to implement a custom Hibernate UserType for any
> Enum type you care to persist. Subclassing EnumUserType and binding its Type
> parameter to the Enum of interest generates the code required for Hibernate
> to manage that Enum type. An example can be seen in the
> jobscheduler/scheduler-event-model module. See
> org.sakaiproject.scheduler.events.hibernate.TriggerEventEnumUserType and its
> use in the Hibernate mapping
> org.sakaiproject.scheduler.events.hibernate.TriggerEventHibernateImpl.hbm.xml
> in the same module.
>
> Since kernel/kernel-private seems to have all the framework level support
> for Hibernate in Sakai this seemed like the appropriate place. If there are
> no arguments for an alternate spot I'd like to move forward on this change
> so EnumUserType can be used in other modules outside of
> jobscheduler/scheduler-event-model.
>
> Cheers,
>
>   Duffy Gillman
>   Sr. Software Engineer
>   The rSmart Group, Inc.
> _______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>
> TO UNSUBSCRIBE: send email to
> sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of
> "unsubscribe"
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://collab.sakaiproject.org/pipermail/sakai-dev/attachments/20110303/289becba/attachment.html 


More information about the sakai-dev mailing list