-->
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.  [ 3 posts ] 
Author Message
 Post subject: Newbie trying to add HiLo to cat tutorial
PostPosted: Fri Jul 20, 2007 7:56 pm 
Newbie

Joined: Fri Jul 20, 2007 7:45 pm
Posts: 12
Location: Amgen Corp
Hi,

This is my first post. I just did the cat tutorial and it works great. I am using SQL Server 2005 (express) for backing store.

I decided that I wanted the cat ID to have autogenerated numbers like "1" "2" "3" etc... so I changed my mapping file like this:

<id name="Id">
<column name="CatId" sql-type="int64" not-null="true"/>
<generator class="hilo">
<param name="table">hi_value</param>
<param name="column">next_value</param>
<param name="max_lo">100</param>
</generator>
</id>

I added a "hi_value" table to my Quickstart database with a single column named "next_value" typed as "bigint" which is the 64bit integer for SQL Server 2005.

When I run the rebuilt solution I get an exception at NHibernate.Id.IdentifierGeneratorFactory.Create(String strategy, Itype type …
“type is not a ValueTypeType\r\nParameter name: type”

Any ideas?

Cheers,
Fred

_________________
Fred Stann
Solutions Architect


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 21, 2007 11:18 am 
Hibernate Team
Hibernate Team

Joined: Tue Jun 13, 2006 11:29 pm
Posts: 315
Location: Calgary, Alberta, Canada
Instead of this:
Code:
<id name="Id">
  <column name="CatId" sql-type="int64" not-null="true"/>
  ...

try this:
Code:
<id name="Id">
  <column name="CatId" type="Int64" not-null="true"/>
  ...

or this:
Code:
<id name="Id" column="CatId" type="Int64" not-null="true">
   ...

_________________
Karl Chu


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 23, 2007 1:53 pm 
Newbie

Joined: Fri Jul 20, 2007 7:45 pm
Posts: 12
Location: Amgen Corp
Hi Karlchu,

The second option you provided worked when I took off the not-null attribute (I got an exception complaining about it).

Thanks so much. I now have cats with ids that go from 1-> n.

Cheers,
Fred

_________________
Fred Stann
Solutions Architect


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