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: optimusprime (06 Feb 2006, 19:24) Replies: 1, Views: 28509
Subject: Problem
Has anyone ever tried this? The method below throws an exception:

public void nullSafeSet(PreparedStatement st, Object value, int index) 
            throws HibernateException, SQLException {
        try {
            Object identifier = value != null ?
identifierMethod.invoke(value, new Object[0]) : null;
            st.setObject(index, identifier);
        }
        catch(Exception exception) {
            throw new HibernateException(
                    "Exception while invoking identifierMethod of
enumeration class: ", exception);

        } 
    }

Well, invoke shouldn`t be used with an instance and not a class
declaration? It's throwing an IllegalArgumentException:object is not an
instance of declaring class

If i hack it and put StateEnum.FL instead I get it working. As I don't
know enums quite enough I really do not have an answer for that, wonder
if someone does.

Regars
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]