-->
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: Stop Hibernate passing PK on insert.
PostPosted: Mon Jan 09, 2006 10:24 am 
Newbie

Joined: Mon Aug 08, 2005 5:57 am
Posts: 6
I have a table mapped like so:

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<!--
Auto-generated mapping file from
the hibernate.org cfg2hbm engine
-->
<class name="uk.audit.glue.Action" table="ACTION" schema="AUDIT">
<id name="actionSan" type="big_decimal">
<column name="ACTION_SAN" precision="22" scale="0" />
<generator class="uk.domain.generator.AIdentifierAudit" />
</id>
<many-to-one name="loginSession" class="uk.audit.glue.LoginSession">
<column name="LOGINSESSION_SAN" precision="22" scale="0" not-null="true" />
</many-to-one>
<many-to-one name="actionType" class="uk.audit.glue.ActionType">
<column name="ACTIONTYPE_SAN" precision="22" scale="0" not-null="true" />
</many-to-one>
<property name="actionTime" type="timestamp">
<column name="ACTION_TIME" length="7" />
</property>
<property name="actionResultCount" type="big_decimal">
<column name="ACTION_RESULT_COUNT" precision="22" scale="0" />
</property>
<property name="actionCriteria" type="string">
<column name="ACTION_CRITERIA" length="2000" />
</property>
</class>
</hibernate-mapping>

Currently the id is generated using the AIdentifierAudit class. However I wish to change this to have Oracle handle the primary key generation. What should I change the mapping to, to stop Hibernate passing a primary key when inserting a new row?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 09, 2006 2:43 pm 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
<generator class="native"/>


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.