-->
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.  [ 1 post ] 
Author Message
 Post subject: Java Klassen aus NHibernate-Mapping erzeugen
PostPosted: Wed Apr 04, 2007 3:49 am 
Newbie

Joined: Fri Mar 30, 2007 9:25 am
Posts: 1
Hallo,

ich würde gern Java-Klassen aus einem gegebenen Mapping erstellen,
das Mapping wurde jedoch mit NHibernate erstellt. Es funktioniert für .NET einwandfrei.

Sehr schön wäre natürlich auch wenn ich gleich die DDL für die Postgres-DB erzeugen könnt.

Grundsätzliche Frage, ist dies überhaupt möglich? Wenn ja wie?

Danke schon mal.

Der DOCTYPE-Tag war selbverständlich nicht von Anfang an drin, den musste ich von Hand hinzufügen um die "Gramma-Exception" zu lösen.

Ursprünglich sah der hibernate-mapping-Tag wie folgt aus
Code:
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">

führte aber zu folgendem Fehler
Code:
org.hibernate.InvalidMappingException: Could not parse mapping document from file D:\Projekte\JSFProfilEditor\hibernate_xml\mapping.hbm.xml
  org.hibernate.MappingException: invalid mapping
    org.hibernate.MappingException: invalid mapping
    org.xml.sax.SAXParseException: Attribute "xmlns" must be declared for element type "hibernate-mapping".

Aus diesem Grund hab ich dann den namespace entfernt, bloß komm ich
jetzt nicht mehr weiter.

Danke schon mal!

Entwicklungsumgebung
Eclipse3.2

Hibernate version:
HibernateTools3.2
Hibernate3

Mapping documents:
Code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!--Generated from NHibernate.Mapping.Attributes on 2007-04-03 14:24:43Z.-->
<hibernate-mapping>
  <class name="Filter, Hibernate" table="tbl_filter">
    <id name="Filterid" column="filterid" type="String">
      <generator class="uuid.hex" />
    </id>
    <property name="Filtername" column="filtername" not-null="true" unique="true" />
    <set name="FilterCriteria" cascade="all">
      <key column="filterid" />
      <one-to-many class="FilterCriteria, Hibernate" />
    </set>
  </class>
  <class name="FilterCriteria, Hibernate" table="tbl_filtercriteria">
    <id name="Criteriaid" column="criteriaid" type="String">
      <generator class="uuid.hex" />
    </id>
    <property name="Filtercriteria" column="filtercriteria" />
    <many-to-one name="Filter" class="Filter, Hibernate" column="filterid" />
  </class>
</hibernate-mapping>


Full stack trace of any exception that occurs:
Code:
org.hibernate.InvalidMappingException: Could not parse mapping document from file D:\Projekte\JSFProfilEditor\hibernate_xml\mapping.hbm.xml
  org.hibernate.MappingException: class Filter, HSA.DataAccess.Hibernate not found while looking for property: Filtername
    org.hibernate.MappingException: class Filter, HSA.DataAccess.Hibernate not found while looking for property: Filtername
    java.lang.ClassNotFoundException: Filter, HSA.DataAccess.Hibernate


Name and version of the database you are using:
PostgreSQL 8.2


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

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.