-->
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.  [ 1 post ] 
Author Message
 Post subject: Unable to use sequence in Oracle Nhibernate
PostPosted: Thu May 10, 2007 10:56 am 
Newbie

Joined: Thu May 10, 2007 8:55 am
Posts: 1
Location: Lagos, Nigeria
Inserting record into Oracle Database.

I have tried this hbl files in sql server my sql it worked perfectly using identity
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="StockControl.Map.UNIT_TABLE, StockControl" table="UNIT_TABLE" dynamic-update="true">
<id name="ID" column="ID" type="Int32" unsaved-value="0">
<generator class="identity" />
</id>
<property name="UNITDESC" column="UNITDESC" type="String" length="30" unique="true" not-null="true" />
<property name="QTY_CONTAINED" column="QTY_CONTAINED" type="Int32" length="4" />
</class>

</hibernate-mapping


but on trying it in oracle I was only able to read records, to insert record is the problem because of sequence

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="StockControl.Map.UNIT_TABLE, StockControl" table="UNIT_TABLE" dynamic-update="true">
<id name="ID" column="ID" type="Int32" unsaved-value="0">
<generator class="sequence">
<param name="sequence">unittable_sequence</param>
</generator>
</id>
<property name="UNITDESC" column="UNITDESC" type="String" length="30" unique="true" not-null="true" />
<property name="QTY_CONTAINED" column="QTY_CONTAINED" type="Int32" length="4" />
</class>

</hibernate-mapping>

I was able to create tables, sequence automatically in oracle and tables, identity in My sql, Sql server by using Nhibernate method
GenerateSchemaCreationScript();


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.