-->
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: What is definition of HiLo sequence table?
PostPosted: Fri Nov 07, 2003 5:26 pm 
Beginner
Beginner

Joined: Wed Oct 08, 2003 4:22 pm
Posts: 29
Need the DDL so can create in Teradata database (can't find anywhere in the 116 page reference PDF or by searching)

thx


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 07, 2003 5:34 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Code:
public class TableGenerator implements PersistentIdentifierGenerator, Configurable {
        ......

   public String[] sqlCreateStrings(Dialect dialect) throws HibernateException {
      return new String[] {
         "create table " + tableName + " ( " + columnName + " " + dialect.getTypeName(Types.INTEGER) + " )",
         "insert into " + tableName + " values ( 0 )"
      };
   }


}


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 07, 2003 5:48 pm 
Beginner
Beginner

Joined: Wed Oct 08, 2003 4:22 pm
Posts: 29
Thanks Gavin!

So does it create 1 table per O/R mapped class?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 07, 2003 5:51 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
The table and column name are specified by <param> elements in the <id> mapping. Otherwise there is a default for all classes.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 07, 2003 5:54 pm 
Beginner
Beginner

Joined: Wed Oct 08, 2003 4:22 pm
Posts: 29
Okay, thanks.

However, think I see a problem for our configuration:
1) underlying database doesn't support SEQUENCEs.
2) we're using an App Server (JBoss)

*TableHiLoGenerator says it can't be used in App Server environment.

*SequenceHiLoGenerator says it needs underlying oracle-style sequence function


Am I SOL?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 07, 2003 6:04 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Have you looked at "session bean hilo generator" pattern on the wiki?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 07, 2003 6:06 pm 
Beginner
Beginner

Joined: Wed Oct 08, 2003 4:22 pm
Posts: 29
will take a look, thanks -


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.