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.  [ 6 posts ] 
Author Message
 Post subject: Identifier is null on client side
PostPosted: Sun Jun 19, 2005 11:16 pm 
Newbie

Joined: Fri Jun 03, 2005 2:15 pm
Posts: 14
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

[b]Hibernate version:3.0[/b]

[b]Mapping documents:[/b]

[b]Code between sessionFactory.openSession() and session.close():[/b]

[b]Full stack trace of any exception that occurs:[/b]

[b]Name and version of the database you are using:[/b]

[b]The generated SQL (show_sql=true):[/b]

[b]Debug level Hibernate log excerpt:[/b]

We are using hibernate and pointbase on the server side. We set up a web service: getDeviceById(Long id). The web service engine is Axis.

The interesting thing is that after we get the Device object from database. The identifier on the server side is the primary key, but on the client side is null.

My question is how to keep the object's identifier on client side? (we define id in the pojos).

Thanks.

Wade


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 20, 2005 2:12 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
do you remember to update the client side object with the new fresh instance you will get when it is serialized over the wire ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: identifier is null on client side
PostPosted: Mon Jun 20, 2005 9:47 am 
Newbie

Joined: Fri Jun 03, 2005 2:15 pm
Posts: 14
The client side code is as the following:

device = new Device();
device = stub.getDeviceById(new Long(1));
System.out.println("the device id is: " + device.getId());

Then the Id printed out is null.

More instructions would be appreciated.

Wade


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 20, 2005 9:55 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
so your stub.getDeviceById apparently doesn't return the actual object returned by hibernate (hibernate sets the id when it loads objects)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: identifier is null
PostPosted: Mon Jun 20, 2005 9:59 am 
Newbie

Joined: Fri Jun 03, 2005 2:15 pm
Posts: 14
Except the id is null, all other parts are OK, such as I use device.getPin(), then it gives me the right value: pin.

Appreciate it for help.

Wade


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 20, 2005 3:34 pm 
Newbie

Joined: Fri Jun 03, 2005 2:15 pm
Posts: 14
just a fast remind, need to declare the setId as public instead of private


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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.