Hi Paulo,

I gave that a try but instead it creates a column that is varbinary
(8000). any other ideas?

Thanks!
M

PS Sorry if this message appears twice, IE being wierd.

On Apr 16, 7:06 pm, Paulo Quicoli <pauloquic...@gmail.com> wrote:
> I think you can specify in mapping file, the SQL type for that field, and
> so, hbm2ddl will generate correctly
>
> 2009/4/15 Maxus <rtypestud...@gmail.com>
>
>
>
>
>
>
>
> > Hi Nhibernate Users!
>
> > I have a small issue with using the timestamp column type in SQL
> > server 2005, when I run the schema export utility (the one in
> > Nhibernate.tool.hbm2ddl), it creates the timestamp as a DateTime
> > field, which causes my inserts to fail, and isn't correct.
>
> > Anyone know how I can get nhibernate to create the table using
> > "Timestamp" rather than "DateTime" for the columns defined as
> > "Timestamp"?
>
> > If not, how are other people implement concurrency management on SQL
> > Server 2005?
>
> > This is the code that creates the DB from the schema files:
>
> > // Rebuild the database tables according to the schema files.
> > SchemaExport SchemaExport = new SchemaExport
> > (_unitOfWorkFactory.Configuration);
>
> > // Execute the schema update.
> > SchemaExport.Execute(script, export, justDrop, format);
>
> > NHibernate version::2.0.50727
>
> > Mapping documents::
>
> > <?xml version="1.0" encoding="utf-8" ?>
> > <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
> > assembly="TEST.DataAccess.Tests" namespace="TEST.DataAccess.Tests">
> > <class name="TestPerson" optimistic-lock="version">
> > <id name="Id">
> > <generator class="guid"/>
> > </id>
> > <version column="Version" type="Timestamp" name="Version" unsaved-
> > value="null" generated="always" />
> > <property name="Name" not-null="true" length="50"/>
> > <property name="Birthdate" not-null="true"/>
> > </class>
> > </hibernate-mapping>
>
> > Name and version of the database you are using:
>
> > Microsoft - SQL Server 2005
>
> > The generated SQL (show_sql=true):
>
> > NHibernate: INSERT INTO [Test].[dbo].TestPerson (Name, Birthdate, Id)
> > VALUES (@p0, @p1, @p2); @p0 = 'John Doe', @p1 = '15/12/1915 12:00:00
> > AM', @p2 = '10c27ab9-75d5-4351-ab4d-4cd04a439b7c'
>
> --
> Paulo R. Quicoli
>
> Editor Técnico - ClubeDelphi Magazine - DevMedia- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to nhusers@googlegroups.com
To unsubscribe from this group, send email to 
nhusers+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to