Hello,
I face a very strange Problem here. I've got 3 tables. 2 of them linked to the third one as a many-to-many collection:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated 24.07.2009 17:47:28 by Hibernate Tools 3.2.4.GA -->
<hibernate-mapping>
<class name="com.YYYY.XXXX.mopad2009.data.TKolonne" table="T_KOLONNE" schema="dbo" catalog="XXXX_DATA">
<id name="IPkKolonne" type="java.lang.Integer">
<column name="I_PK_KOLONNE" />
<generator class="identity"></generator>
</id>
<property name="SBeschreibung" type="string">
<column name="S_BESCHREIBUNG" length="50" />
</property>
<set name="TAuftragszeiles" inverse="true" lazy="true" table="T_AUFTRAGSZEILE" fetch="select">
<key>
<column name="I_PK_KOLONNE" not-null="true" />
</key>
<one-to-many class="com.YYYY.XXXX.mopad2009.data.TAuftragszeile" />
</set>
<set name="TRessources" inverse="false" lazy="true" table="T_KOLONNE_RESSOURCE" fetch="select">
<key>
<column name="I_PK_KOLONNE" not-null="true" />
</key>
<many-to-many entity-name="com.netzlink.XXXX.mopad2009.data.TRessource">
<column name="I_PK_RESSOURCE" not-null="true" />
</many-to-many>
</set>
<set name="TMitarbeiters" inverse="false" lazy="true" table="T_KOLONNE_MITARBEITER" fetch="select">
<key>
<column name="I_PK_KOLONNE" not-null="true" />
</key>
<many-to-many entity-name="com.YYYY.XXXX.mopad2009.data.TMitarbeiter">
<column name="I_PK_MITARBEITER" not-null="true" />
</many-to-many>
</set>
</class>
</hibernate-mapping>
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated 24.07.2009 17:47:28 by Hibernate Tools 3.2.4.GA -->
<hibernate-mapping>
<class name="com.YYYY.XXXX.mopad2009.data.TMitarbeiter" table="T_MITARBEITER" schema="dbo" catalog="XXXX_DATA">
<id name="IPkMitarbeiter" type="java.lang.Integer">
<column name="I_PK_MITARBEITER" />
<generator class="identity"></generator>
</id>
<property name="SName" type="string">
<column name="S_NAME" length="59" />
</property>
<property name="SVorname" type="string">
<column name="S_VORNAME" length="50" />
</property>
<property name="SKuerzel" type="string">
<column name="S_KUERZEL" length="10" />
</property>
<set name="TKolonnes" inverse="true" lazy="true" table="T_KOLONNE_MITARBEITER" fetch="select">
<key>
<column name="I_PK_MITARBEITER" not-null="true" />
</key>
<many-to-many entity-name="com.YYYY.XXXX.mopad2009.data.TKolonne">
<column name="I_PK_KOLONNE" not-null="true" />
</many-to-many>
</set>
<set name="TTaetigkeitsnachweises" inverse="true" lazy="true" table="T_TAETIGKEITSNACHWEIS" fetch="select">
<key>
<column name="I_PK_MITARBEITER" not-null="true" />
</key>
<one-to-many class="com.YYYY.XXXX.mopad2009.data.TTaetigkeitsnachweis" />
</set>
</class>
</hibernate-mapping>
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated 24.07.2009 17:47:28 by Hibernate Tools 3.2.4.GA -->
<hibernate-mapping>
<class name="com.YYYY.XXXX.mopad2009.data.TRessource" table="T_RESSOURCE" schema="dbo" catalog="XXXX_DATA">
<id name="IPkRessource" type="java.lang.Integer">
<column name="I_PK_RESSOURCE" />
<generator class="identity"></generator>
</id>
<property name="SBezeichnung" type="string">
<column name="S_BEZEICHNUNG" length="50" />
</property>
<set name="TTankbelegs" inverse="true" lazy="true" table="T_TANKBELEG" fetch="select">
<key>
<column name="I_PK_RESSOURCE" not-null="true" />
</key>
<one-to-many class="com.YYYY.XXXX.mopad2009.data.TTankbeleg" />
</set>
<set name="TRessourceTaetigkeits" inverse="true" lazy="true" table="T_RESSOURCE_TAETIGKEIT" fetch="select">
<key>
<column name="I_PK_RESSOURCE" not-null="true" />
</key>
<one-to-many class="com.YYYY.XXXX.mopad2009.data.TRessourceTaetigkeit" />
</set>
<set name="TKolonnes" inverse="true" lazy="true" table="T_KOLONNE_RESSOURCE" fetch="select">
<key>
<column name="I_PK_RESSOURCE" not-null="true" />
</key>
<many-to-many entity-name="com.YYYY.XXXX.mopad2009.data.TKolonne">
<column name="I_PK_KOLONNE" not-null="true" />
</many-to-many>
</set>
</class>
</hibernate-mapping>
Everytime I try to access the T_MITARBEITER table I get this exception:
Quote:
2009-07-24 18:34:31,488 WARN [org.hibernate.util.JDBCExceptionReporter] - <SQL Error: 208, SQLState: S0002>
2009-07-24 18:34:31,488 ERROR [org.hibernate.util.JDBCExceptionReporter] - <Ungültiger Objektname 'dbo.T_KOLONNE_MITARBEITER'.>
So it tries to tell me, that the T_KOLONNE_MITARBEITER table does not exist. But it exists in the database. When I execute the sql code generated by hibernate in sql query analyzer, it works fine. I can access the TRessource objects without any problems. Setting the hibernate.default_schema property to "dbo" didn't help either. Both tables have full access for schema dbo set. As soon as hibernate and jdbc are involved it doesn't work.
Server is MS SQL 2005.
Thanks in advance for any help
Frank