Thread:
 Problem 
 optimusprime   06 Feb 2006, 19:24 
 Re: Problem 
 birkirb   14 Jun 2006, 05:55 

Comment
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
From: birkirb (14 Jun 2006, 05:55) Replies: 0, Views: 25467
Subject: Re: Problem
This seems to have fixed the GenericEnumUserType for me.  Very handy.
-----

public void nullSafeSet(PreparedStatement st, Object value, int index)
throws HibernateException, SQLException 
{
  try
  {
    if(value == null)
    {
      st.setObject(index, null);
    }
    else
    {
      Object identifier = identifierMethod.invoke(value, new Object[0]);
      type.set(st,identifier,index);
    }
  }
  catch (Exception exception)
  {
    throw new HibernateException("Exception while invoking
identifierMethod '" + identifierMethod + "' of enumeration class: '" +
enumClass + "'",exception);
  }
}
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
© Copyright 2006, Red Hat Middleware, LLC. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc. [Privacy Policy]