-->
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: Identity in not id column
PostPosted: Tue Jul 13, 2004 6:52 am 
Newbie

Joined: Tue Jul 13, 2004 6:16 am
Posts: 1
I'm using M$SQL Server and i have to do something like this:

Code:
create table Abc
(
    counter  int not null identity(1, 1),
    IDabc1   int not null, -- --> Abc1.IDabc1
    IDabc2   int not null, -- --> Abc2.IDabc2
    blabla   varchar(20),

    primary key (IDabc1, IDabc2)
)


Haw can i force hibernate to generate such DDL - how to write mapping: ???

Code:
<class name="Abc">
    <property name="counter" type="int"> <!-- ???? generator ???? -->
    <composite-id>
        <key-many-to-one name="IDabc1" class="Abc1"/>
        <key-many-to-one name="IDabc2" class="Abc2"/>
    </composite-id>
    <property name="blabla" type="string" />
</class>


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 13, 2004 8:52 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Hibernte can't generate arbitrary identity columns. You will have to export the DDL to a file and add it yourself.

_________________
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.  [ 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.