Hello,

in NHibernate 3.3 I am trying to translate the following mapping to code:

<id name="Id">
    <column name="id" sql-type="int(10)" not-null="true"/>
    <generator class="native"/>
</id>


So far I've got:

Id(x => x.Id, m => { m.Generator(Generators.Native); });

The existing MySQL schema is using int(10) for some columns and int(11) for 
others. My questions:

   - How do I specify those SQL types (or get NHibernate to generate 
   different int types) using mapping by code for ids and properties?
   - Do I need a to implement a custom type (IUserType)?
   - Is m.Length(...) relevant for integer types?

I have seen various samples using m.Type(...) with TypeFactory or 
NHibernateUtil to specify various string types, but none which allow me to 
specify a specifc SQL type. The C# code is using "int" in both cases, but 
the SQL should match what exists in the given database.

Cheers,

Thomas Luzat

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to