-->
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.  [ 11 posts ] 
Author Message
 Post subject: hdb2java with middlegen 2 vo sample
PostPosted: Wed Jan 28, 2004 8:17 pm 
Regular
Regular

Joined: Mon Nov 03, 2003 6:10 am
Posts: 75
I was reading the note about the new middlegen plugin at http://www.hibernate.org/98.html

It has reference to a cascading issue and gives a workaround.

I noticed in the script that it references to MapRequest.hbm.xml,MapRun.hbm.xml

Are these something that hibernate does internally and hence I don't have to worry about? Is there a better workaround.

Also, what is the difference between non cascading and cascading?


Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 29, 2004 4:26 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
I suggest you not worry to much about cascading at this point. Keep it simple and get the sample running, read the HIbernate documentation (which will include cascading options). FYI - Middlegen at the moment does not allow you to change that option (as yet) so the part of the documentation is a work around. The user would supply your own hbm files.

There is a lot to learn although you don't need to do much to get started. Its worth the effort.


Top
 Profile  
 
 Post subject: middlegen
PostPosted: Thu Jan 29, 2004 4:32 am 
Regular
Regular

Joined: Mon Nov 03, 2003 6:10 am
Posts: 75
I have the sample working. I also have the workaround working.
I wasn't really sure what it was suppose to do, so I wasn't sure if the workaround had actually 'worked', even though it completed without errors.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 29, 2004 4:38 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
You dont have to use this workaround. The standard mapping produced is not bad in general. Some uses have asked how to change the cascading settings so this an approach. In anycase, glad to see your over the hard part.


Top
 Profile  
 
 Post subject: top down or bottom up
PostPosted: Thu Jan 29, 2004 5:09 am 
Regular
Regular

Joined: Mon Nov 03, 2003 6:10 am
Posts: 75
We are still evaluating which direction would be best.

I think we are leaning toward the following:

XML schema (already exist)
to pojo using CASTOR XML
?? either modify code in CASTOR or run util after the fact to produce either hbm or xdoclet for POJOs. ?? CAn't believe no one has done this yet! OR can't find them if they have.
then hbm2ddl
then to db


Since the xml schemas are already very detailed this seems the best approach. But I am still curious as to the database model that hibernate will produce.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 29, 2004 9:58 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
If you include a reasonable level of DDL information in the mapping document you will find it will do a good job creating the database. It is core and functionality that is central to Hibernate (used throughout the test suite for example).


Top
 Profile  
 
 Post subject: initial testing
PostPosted: Fri Jan 30, 2004 1:10 am 
Regular
Regular

Joined: Mon Nov 03, 2003 6:10 am
Posts: 75
Well I spent a few hours today running some tests with Castor xml.
I got in and fudged with the code and now have it producing hibernate xdoclet tags in the pojos it creates. This alone will save us a heap of time. (There are hundreds of them)

I will most likely keep on this a while longer.. I haven't gotten it working for Complex types (one to many etc). Nor does it include any info about nullable, length etc. I am confident I can get this out of the xsd however.

Is there a good reference to use to figure out how to best create these mapping tags? i.e. best practices? I want it to be as detailed as the middlegen stuff would create but from the xsd vs database.

Also, if anyone has already done this.. I would appreciate any feedback or code.

Troy


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 01, 2004 8:31 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Sounds good although you have some work still to go. I would be interested to have a look after you have it working.


Top
 Profile  
 
 Post subject: xdoclet vs middlegen
PostPosted: Fri Nov 17, 2006 4:07 am 
Newbie

Joined: Fri Nov 17, 2006 4:02 am
Posts: 2
Hi,
Evan I have a requirement in my project where I need to persist the JXAB objects into database. Can any one suggest what would be the best approach, using middlegen where we need to put every thing from JAXB objects to data objects or persisting the JAXB objects directly into database where the hibernate files are generated using xdoclet.

_________________
Raghu


Top
 Profile  
 
 Post subject: JAXB and hibernate
PostPosted: Fri Nov 17, 2006 4:35 am 
Regular
Regular

Joined: Mon Nov 03, 2003 6:10 am
Posts: 75
We ended up writing assemblers to convert from our JAXB objects (that are auto gen'd) and our hibernate Objects (that are auto gen'd to start, but manually maintained). We use doclet hibernate tags to dynamically build the hbm files. This has worked out well for us.


Top
 Profile  
 
 Post subject: hiberante and jaxb
PostPosted: Fri Nov 17, 2006 11:09 am 
Newbie

Joined: Fri Nov 17, 2006 4:02 am
Posts: 2
so you suggest us to go for a layer where we pick up the data from the JAXB object and save it in hibernate objects. Thanks a lot for the suggestion.

_________________
Raghu


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