Hi,
I have some problem with the finder method using a long type, here is my
finder:
    <id
        name="taskno"
        type="long"
        column="TASKNO"
    >
        <meta attribute="finder-method">findByTaskNo</meta>
        <generator class="net.sf.hibernate.id.SequenceGenerator">
            <param name="sequence">TASK_SEQ</param>
        </generator>        
    </id>

Problem is that the getFieldAsHibernateType receive the type "Long" and
the mapping in the Map hibType is 

hibType.put("long", "Hibernate.LONG");

So my finder method is 

    public static List findByTaskNo(Session session, java.lang.Long
taskno) throws SQLException, HibernateException {
        List finds = session.find("from
com.recruitsoft.rcc.hibernate.Task as task where task.taskno=?", taskno,
Hibernate.OBJECT);
        return finds;
    }

The Hibernate.OBJECT is causing the problem, so to patch the problem i 
simply add a new type in the map hibType.put("Long", "Hibernate.LONG");
But there is probably a better way to do that, would it be a good idea
to use a case-ins. object as the key of the map? That would prevent
side-effects of other modifications.

Any comments?

Richard



-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to