Hello,
I encounter a problem with nHibernate 1.2 et MySQL 5.0. This problem didn't occurs with MYSQL 4.1.
Actually, the problem occurs at the tables creation, when the table are created, there is no default value. So when I create an object of the base class, everythings from other class are set to null and I receive the exception :
"The field "TripPathID" has no default value."
Here is part of the mapping file :
Code:
<?xml version="1.0" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-lazy="false">
<class name="DOL.GS.GenericItem, GameServer" table="`item`">
<id name="ItemID" column="`ItemID`" unsaved-value="0">
<generator class="native" />
</id>
<discriminator column="GenericItemType"/>
<property name="Name" type="String(255)" not-null="true" column="`Name`"/>
<property name="Level" type="Byte" not-null="true" column="`Level`"/>
<property name="Weight" type="Int32" not-null="true" column="`Weight`"/>
<property name="Value" type="Int64" not-null="true" column="`Value`"/>
<property name="Realm" not-null="true" column="`Realm`"/>
<property name="Model" type="Int32" not-null="true" column="`Model`"/>
<property name="IsSaleable" type="YesNo" not-null="true" column="`IsSaleable`"/>
<property name="IsTradable" type="YesNo" not-null="true" column="`IsTradable`"/>
<property name="IsDropable" type="YesNo" not-null="true" column="`IsDropable`"/>
<property name="QuestName" type="String(255)" not-null="true" column="`QuestName`"/>
<property name="CrafterName" type="String(255)" not-null="true" column="`CrafterName`"/>
<property name="SlotPosition" type="Int32" not-null="true" column="`SlotPosition`"/>
<many-to-one name="Owner" class="DOL.GS.GamePlayer, GameServer" not-null="true" column="`Owner`"/>
<subclass name="DOL.GS.TravelTicket, GameServer">
<property name="TripPathID" type="Int32" not-null="true" column="`TripPathID`" />
</subclass>
<subclass name="DOL.GS.CraftingTool, GameServer">
<property name="Type" not-null="true" column="`Type`" />
</subclass>
<subclass name="DOL.GS.RespecStone, GameServer">
<property name="RespecType" not-null="true" column="`RespecType`" />
</subclass>
....
in the nHibernate configuration file I changed the dialect to use MySQL5.Dialect, but this as no effect.
If someone has some advice, or solution, thanks you.