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.  [ 2 posts ] 
Author Message
 Post subject: How to support postgres and sqlserver?
PostPosted: Tue Aug 21, 2007 6:35 am 
Newbie

Joined: Wed May 23, 2007 4:09 am
Posts: 16
I wish my customers to be able to use either postgres or sqlserver.
Thanks to hibernate they just have to edit the config file and restart.
The problem is the mapping of the unique identifier.

Postgres:
<id>
<generator class="native">
<sequence content = "myguid" />
</generator>
</id>

Sqlsever
<id>
<generator class="native" />
</id>

How should I modify my id generator to support both sqlserver and postgres?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 21, 2007 9:02 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Firstly, the first mapping option will still work under MSSQL. You should try it.
Secondly, I would consider using the new sequence generator(s) that were recently released as it will allow a more consistent id generation policy between the two DBs. It will result in more tables in the MSSQL database though (which, in my view, is a non-issue).


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