-->
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.  [ 4 posts ] 
Author Message
 Post subject: sometimes generator class="assigned", sometimes &q
PostPosted: Wed Mar 22, 2006 6:40 am 
Newbie

Joined: Wed Mar 22, 2006 6:30 am
Posts: 9
hiho,

in a persistance layer for jasper reports (ussrp.com) there is a Report object. in data loading, the pk must be explicit (to support sub-reports).

at runtime, when a user uploads a new report, the pk must auto increment.

ussrp accomplishes this by having two hib. mapping files for the one Report object. (there is a second 'ReportAssigned' object which is empty, just extends Report, and is used to support the second mapping file.)

...this all works fine until i try to use both objects in one jvm, then my hql starts seeing double :-). (e.g. Report rep = (Report)session.createQuery("from net.sf.ussrp.bus.Report where DESCRIPTION = '"+ description + "'").uniqueResult(); returns 2 records/error)

do you have an idea (pattern) for how to have a single object that must somtimes use generator class="assigned", sometimes "increment"?

thanks!

tom


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 22, 2006 9:53 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
I'd do that the heavy-handed way: make the column non-identity, create your own generator that selects the highest current ID and adds one, and allows the user to modify that before writing to the DB.

It may be that the sequence generator will do what you want, but I've never used it so I can't confirm that.


Top
 Profile  
 
 Post subject: thanks - new to forum...
PostPosted: Mon Mar 27, 2006 6:30 pm 
Newbie

Joined: Wed Mar 22, 2006 6:30 am
Posts: 9
thanks - good idea. ...need to get used to forum, did not get email on your post.

...i like your idea and will put it into the next ussrp release and remove the "double trouble" hibernate mapping :-). ...but it was fun while it lasted...

thanks again,

tom

tenwit wrote:
I'd do that the heavy-handed way: make the column non-identity, create your own generator that selects the highest current ID and adds one, and allows the user to modify that before writing to the DB.

It may be that the sequence generator will do what you want, but I've never used it so I can't confirm that.


Top
 Profile  
 
 Post subject: Problem in ussrp run
PostPosted: Thu Oct 05, 2006 2:05 am 
Newbie

Joined: Thu Oct 05, 2006 1:56 am
Posts: 1
Hello!
I'm bigginer in ussrp and download this application.
I read setup file and edit files according to it. I start Tomcat but when i write url in explorer (Mozila) it doesn't run and i get this error ("HTTP Status 404 - /ussrp") .
I realy need your help.
Thanks.


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