Hi,
I have 2 databases in the some Sybase Install, DBUsers and DBProcess
My problem is, that in the database DBProcess i have onde table "tbProc" that have logic FK with one table of DBUsers.tbuser
ex:
DBUsers:
CREATE TABLE TbUser (
CdUser INT NOT NULL,
NmUser VARCHAR(100) NOT NULL,
PRIMARY KEY(CdUser),
);
DBProcess:
CREATE TABLE TbProc (
CdOperacao INT NOT NULL,
CdUser INT NOT NULL,
NmProcess VARCHAR(100) NOT NULL,
);
In Hibernate mapping i need conf this two tables to be access for the SessionFactory
The connection Pool connecting first in DBUsers :
jdbc:sybase:Tds:10.40.16.20:4500/dbuser
I'm trying mapping tables-objects :
tbuser.hbm.xml
<?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" >
<hibernate-mapping package="vo">
<class name="userVO" table="Tbuser">
<composite-id name="id" class="TbcompradorfinameKey">
<key-property name="cduser" column="CdUser" type="java.lang.Integer"/>
</composite-id>
<property name="nmuser" column="NmUser" type="java.lang.String" not-null="true" />
</class>
</hibernate-mapping>
<?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" >
t
bproc.hbm.xml
<hibernate-mapping package="vo">
<class name="processVO"
table="DBProcess..Tbproc">
<composite-id name="id" class="TbcompradorfinameKey">
<key-property name="cdoperacao" column="CdOperacao" type="java.lang.Integer"/>
</composite-id>
<property name="cduser" column="CdUser" type="java.lang.Integer" not-null="true" />
<property name="nmprocess" column="NmProcess" type="java.lang.String" not-null="true" />
</class>
</hibernate-mapping>
But the mapping tbproc.hbm.xml does not work with table="DBProc..Tbproc".
Any one can help me, about how i can mapping table of other database ?
thx
Gustavo
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
3.0
Mapping documents:
tbuser.hbm.xml
tbproc.hbm.xml
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
Sybase 12
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt: