-->
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.  [ 7 posts ] 
Author Message
 Post subject: <generator class="sequence"><param> Re
PostPosted: Tue Nov 16, 2004 7:16 pm 
Newbie

Joined: Wed Jun 30, 2004 5:24 pm
Posts: 5
Hibernate version:
2.1.6

Name and version of the database you are using:
PostgreSQL 7.4.6

I just found out that you can write a generator block with a defined sequence name:
<generator class="sequence">
<param name="sequence">my_seq</param>
</generator>

I only found this out by accident as I was looking through the examples at the end of the Hibernate documentation. Is there any single reference source that describes all such 'undocumented' params to <generate>? Is it something that's too database specific maybe?

I am kind of surprised that the acceptable <param>s for the <generate> block seem to be poorly documented. The rest of the Hibernate documentation is excellent! Unfortunately, I even had trouble googling this information up.

I also wonder what other features I'm missing out on... anybody seen other undocumented or poorly documented items that might be good to know about?

Cheers


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 17, 2004 1:25 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
http://www.hibernate.org/hib_docs/api/

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject: Ok, but where is the documentation?
PostPosted: Wed Nov 17, 2004 1:47 pm 
Newbie

Joined: Wed Jun 30, 2004 5:24 pm
Posts: 5
That's a nice link, but where is the information I asked for?

I looked at the API docs for SequenceGenerator several days ago, but they do not mention what the legal param values are. SequenceGenerator gets a Properties object containing the params, but it does not indicate what the params can be.

Where is this documented?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 17, 2004 1:48 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
On the sequence generator API documentation page!

"Mapping parameters supported: sequence, parameters."

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 17, 2004 1:51 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
They are database dependent, of course. I've added an example for Oracle.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject: Thank you, that's what I was looking for.
PostPosted: Wed Nov 17, 2004 2:02 pm 
Newbie

Joined: Wed Jun 30, 2004 5:24 pm
Posts: 5
So is the API documentation the only place to find out about such features?

The reason I ask is that I recently got a question about Hibernate's sequence generation strategy. I answered incorrectly that hibernate uses a common sequence for all of the persisted object ids. Obviously since I only read the Hibernate documentation, I was ignorant of the poorly documented params to <generate> which allow you to do traditional sequence per table id generation.

To be fair, this information is not presented in the hibernate xDoclet reference (obviously not the Hibernate teams problem) nor is it to be found in either of the Hibernate books at my disposal. Why is this information being relegated to obscure API documentation?

This seems like such a common configuration that I can't believe it is undocumented except for a reference buried in a random API document. I don't want to rant, but given the quality of this project I have been really disappointed by the available information on the generate params.

Does this qualify as a documentation bug that I can report or anything?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 17, 2004 2:04 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
We don't think that API documentation is "obscure", sorry. Its part of our normal documentation and you should definitely consult it right after you have been looking at the reference documentation.

This does not qualify as a documentation bug.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


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