-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Empty Load Result
PostPosted: Thu Jul 23, 2009 12:01 pm 
Newbie

Joined: Thu Jul 23, 2009 11:48 am
Posts: 9
I am trying my first Hibernate-based application, and I cannot get a simple load() to return a result. The relevant line is
Code:
EmployerInfo ei = dao.load(40001);

The load() command is not throwing an error -- it just returns null. The logs say
Code:
DEBUG - SQL                        - select employerin0_.employer_id as employer1_0_0_, employerin0_.employer_name as employer2_0_0_ from zjp_employers employerin0_ where employerin0_.employer_id=?
Hibernate: select employerin0_.employer_id as employer1_0_0_, employerin0_.employer_name as employer2_0_0_ from zjp_employers employerin0_ where employerin0_.employer_id=?
DEBUG - AbstractBatcher            - preparing statement
DEBUG - IntegerType                - binding '40001' to parameter: 1
DEBUG - AbstractBatcher            - about to open ResultSet (open ResultSets: 0, globally: 0)
DEBUG - Loader                     - processing result set
DEBUG - Loader                     - done processing result set (0 rows)

However, when I execute the logged SQL, "select employerin0_.employer_id as employer1_0_0_, employerin0_.employer_name as employer2_0_0_ from zjp_employers employerin0_ where employerin0_.employer_id=40001", directly on the database, it does return one row.

Can anyone suggest what I might be missing? I would be happy to give additional information, but I don't know what would be useful. I am using hibernate-3.2.6.ga.jar.


Top
 Profile  
 
 Post subject: Re: Empty Load Result
PostPosted: Thu Jul 23, 2009 2:25 pm 
Newbie

Joined: Thu Jul 23, 2009 11:48 am
Posts: 9
I figured it out. The ZJP_EMPLOYERS table is owned by another user, so Hibernate was creating a new table of the same name under my user. I had thought that since my user could access the existing table through a public synonym, that would cover it. I guess not.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.