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()
|