Hello.
I'm using NHibernate Version 1.2 an want to create the DB with hbm2dll.
Until now i've never a problem with that. But now I want to create the following tables and on each create only one column is created in table Ids. Can anyone help?
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
namespace="NH.Test"
assembly="Test">
<class name="NH.Test.Customer" table="Customers">
<id name="CustomerId" column="CustomerId" access="nosetter.camelcase-underscore" type="Int64">
<generator class="hilo">
<param name="table">Ids</param>
<param name="column">NextCustomerId</param>
<param name="max_lo">1000</param>
</generator>
</id>
<bag name="Orders" cascade="delete">
<key column="FKCustomerId" />
<one-to-many class="Order" />
</bag>
</class>
</hibernate-mapping>
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
namespace="NH.Test"
assembly="Test">
<class name="NH.Test.Order" table="Orders">
<id name="OrderId" column="OrderId" access="nosetter.camelcase-underscore" type="Int64">
<generator class="hilo">
<param name="table">Ids</param>
<param name="column">NextOrderId</param>
<param name="max_lo">1000</param>
</generator>
</id>
</class>
</hibernate-mapping>
Created DB Table Structure
Code:
CREATE TABLE [dbo].[Ids](
[NextOrderId] [bigint] NULL)
Sincerely
kai