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.  [ 9 posts ] 
Author Message
 Post subject: Newbie issue with Schema generation
PostPosted: Wed Sep 12, 2007 1:19 pm 
Newbie

Joined: Wed Sep 12, 2007 12:18 pm
Posts: 11
I'm new to nHibernate and at the moment I'm just trying to generate a database from my business object classes (which I've decorated with various nHibernate attributes as per the docs).

I manged to wade through various exceptions that were being generated during the validation phase (i.e. when calling cfg.AddInputStream(stream) with HbmSerializer.Default.Validate = true) and now I'm getting an exception when calling:
new NHibernate.Tool.hbm2ddl.SchemaExport(cfg).Create(true, true);

Unlike all the exceptions that were raised during the validation phase though, the exception that I'm getting here isn't very informative:
"Syntax error in field definition."

Which could mean a problem almost anywhere??? Any ideas how I can go about debugging this kind of thing?

Here is the XML that the serializer is producing, which is presumably being used to determine the database schema:

<?xml version="1.0" encoding="utf-8"?>
<!--Generated from NHibernate.Mapping.Attributes on 2007-09-12 19:31:00Z.-->
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="LanHelm.BusinessObjects.LanHelmObject, LanHelm.BusinessObjects">
<id name="Oid">
<generator class="assigned" />
</id>
<property name="ArchivedDate" />
<property name="Created" not-null="true" update="false" insert="true" />
<property name="CreatedById" update="false" insert="true" />
<property name="Modified" />
<property name="ModifiedById" />
<property name="Notes" length="255" />
</class>
<joined-subclass name="LanHelm.BusinessObjects.MachineProfile, LanHelm.BusinessObjects" extends="LanHelm.BusinessObjects.LanHelmObject, LanHelm.BusinessObjects">
<key column="Oid" foreign-key="Oid" />
<property name="MachineName" />
<property name="Domain" />
</joined-subclass>
<joined-subclass name="LanHelm.BusinessObjects.Team, LanHelm.BusinessObjects" extends="LanHelm.BusinessObjects.LanHelmObject, LanHelm.BusinessObjects">
<key column="Oid" foreign-key="Oid" />
<property name="ParentId" />
<property name="TeamName" />
</joined-subclass>
<joined-subclass name="LanHelm.BusinessObjects.UserProfile, LanHelm.BusinessObjects" extends="LanHelm.BusinessObjects.LanHelmObject, LanHelm.BusinessObjects">
<key column="Oid" foreign-key="Oid" />
<property name="ContactId" />
<property name="Domain" />
<property name="UserName" />
<property name="Signature" length="255" />
</joined-subclass>
<joined-subclass name="LanHelm.BusinessObjects.Contact, LanHelm.BusinessObjects" extends="LanHelm.BusinessObjects.LanHelmObject, LanHelm.BusinessObjects">
<key column="Oid" foreign-key="Oid" />
<property name="FileAs" />
<property name="Description" />
<property name="WebSite" />
<property name="Email" />
<property name="Phone" />
<property name="FaxNumber" />
<property name="IsCustomer" />
</joined-subclass>
<joined-subclass name="LanHelm.BusinessObjects.ProfileRole, LanHelm.BusinessObjects" extends="LanHelm.BusinessObjects.LanHelmObject, LanHelm.BusinessObjects">
<key column="Oid" foreign-key="Oid" />
<property name="ProfileId" />
<property name="ModuleName" />
<property name="Rights" />
</joined-subclass>
<joined-subclass name="LanHelm.BusinessObjects.Person, LanHelm.BusinessObjects" extends="LanHelm.BusinessObjects.Contact, LanHelm.BusinessObjects">
<key column="Oid" foreign-key="Oid" />
<property name="NamePrefix" />
<property name="FirstName" />
<property name="LastName" />
<property name="LdapOid" />
<property name="EmployeeId" />
<property name="JobTitle" />
<property name="Organization" />
<property name="Division" />
<property name="Department" />
<property name="Office" />
<property name="Manager" />
<property name="HomePhone" />
<property name="MobilePhone" />
<property name="Pager" />
<property name="IpPhone" />
<property name="TimeZoneOffset" />
</joined-subclass>
</hibernate-mapping>


Top
 Profile  
 
 Post subject: Re: Newbie issue with Schema generation
PostPosted: Wed Sep 12, 2007 4:51 pm 
Newbie

Joined: Wed Sep 12, 2007 12:18 pm
Posts: 11
So it turns out that the automatic Schema generation for MS Access is responsible for the issue... it's generating statements like:

CREATE TABLE foo (
Oid Uniqueidentifier
)

... which is not valide DDL for the JET. I think it's supposed to be something more like:

CREATE TABLE foo (
Oid Guid
)

I have no idea what I'm supposed to do with this information though... is there some official channel for reporting bugs or something?


Top
 Profile  
 
 Post subject: Re: Newbie issue with Schema generation
PostPosted: Thu Sep 13, 2007 7:01 pm 
Regular
Regular

Joined: Fri Jan 20, 2006 7:45 pm
Posts: 97
Location: San Antonio, TX
Also make sure you search through the open issues first so that you don't introduce a dupe.


Last edited by jlockwood on Thu Sep 13, 2007 8:31 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Newbie issue with Schema generation
PostPosted: Thu Sep 13, 2007 7:05 pm 
Newbie

Joined: Wed Sep 12, 2007 12:18 pm
Posts: 11
jlockwood wrote:
Also make sure you search through the open issues first so that you don't introduce a dupe.


Also? Also in addition to what?


Top
 Profile  
 
 Post subject: Ugh
PostPosted: Thu Sep 13, 2007 8:31 pm 
Regular
Regular

Joined: Fri Jan 20, 2006 7:45 pm
Posts: 97
Location: San Antonio, TX
Sorry about that...I replied before the also giving a link to the issues dashboard:
http://jira.nhibernate.org/secure/Dashboard.jspa

I saying that you could post issues here, but check and see if there's already a same issue posted. Sorry about the confusion.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 14, 2007 11:27 am 
Newbie

Joined: Wed Sep 12, 2007 12:18 pm
Posts: 11
Ah, cool... cheers, bug submitted:
http://jira.nhibernate.org/browse/NH-1132

Jimmy


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 14, 2007 3:17 pm 
Regular
Regular

Joined: Fri Jan 20, 2006 7:45 pm
Posts: 97
Location: San Antonio, TX
No credit... :(

LOL

_________________
Dum spiro, spero
-------------------------------
Rate my post if it helps...


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 14, 2007 5:07 pm 
Newbie

Joined: Wed Sep 12, 2007 12:18 pm
Posts: 11
Credit?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 15, 2007 2:41 am 
Regular
Regular

Joined: Fri Jan 20, 2006 7:45 pm
Posts: 97
Location: San Antonio, TX
see left
Quote:
10 credits (What's this?)

_________________
Dum spiro, spero
-------------------------------
Rate my post if it helps...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 posts ] 

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.