-->
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: Generator Assigned
PostPosted: Sun Oct 07, 2007 6:01 am 
Newbie

Joined: Tue Sep 11, 2007 9:12 am
Posts: 4
iam using nhibernate 1.2ga,mysql5,c# VS2005,Vista...

i have mapping file like this:

<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="NameSpaceFirst.Member,NameSpaceFirst" table="member">
<id name="_nhid" column="nhid" type="Int64" unsaved-value="0" access="field">
<generator class="assigned"/>
</id>
<property name="Code" column="memCode" type="String(25)"/>
</class>
</hibernate-mapping>

[test]
public void SaveMember()
{
Member mem = new Member(23, //set _nhid in constructor
"002" //set Code
ISession session= GetSession();
long id = (long)session.Save(mem);
Assert.AreEquals(id,23);
}

the generator type is "assigned", when i try to save using this mapping all work fine no error. but when i see in table "member" no record was saved, whats wrong?

Sorry Problem solved iam forget to Flush()


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.