I started to develop persistance using Hibernate, a few weeks ago. Right now I'm facing a problem I can't figure out how to solve.
My app use data from two different datasources to populate a class. I will try to briefly exemplify my situation.
Code:
package database.one; //let's say this one is my production database.
/**
* @hibernate.class table="A"
*/
public class A {
private String id;
/**
* @hibernate.id column="id"
* generator-class="sequence"
*/
public String getId() { return id; }
public void setId(String id) { this.id = id; }
}
package database.two; //let's say this other is my development database.
/**
* @hibernate.class table="B"
*/
public class B{
private A a;
/**
* @hibernate.many-to-one column="id"
* class="database.one.A"
* unique="true"
*/
public A getA() { return a; }
public void setA(A a) { this.a = a; }
}