i have two pojo classes and want to store these in two different tables that are not related to each other.
example- here i have two classes A and B and i want to store them in two different tables.u am using postgresql and have a persistence.xml file
@Table(name="A")
class A{
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
int aId;
String aName;
int aAge;
//getters and setters;
}
@Entity
@Table(name="B")
class B{
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
int bId;
String bName;
int bAge;
//getters and setters;
}```
**THERE ARE NO RELATIONSHIP A AND B.. I WANT SEPARATE TABLES FOR BOTH OF THEM.**
Reference Link: https://www.boraji.com/hibernate-5-save-or-persist-an-entity-example
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.