H
hazan
Hi,
I have a question in Hibernate:
I have two tables:
A: id, name
B: id, status, fk_id (fk_id is foreign key to table A)
I have java class (called javaClass) which represents table B and one
column of table A:
Id (from B), status, fk_id, name (from A).
The mappings file of table B map all columns of table B to the right
property in javaClass (without mapping column name of table A).
I want to get list of object of type javaClass.
I tried: session.createSQLQuery ( "select B.*, A.name from A, B
where A.id = B.fk_id)
The problem is, how do I map column "name" from table A to member
"name" in the javaClass ?
Thanks,
I have a question in Hibernate:
I have two tables:
A: id, name
B: id, status, fk_id (fk_id is foreign key to table A)
I have java class (called javaClass) which represents table B and one
column of table A:
Id (from B), status, fk_id, name (from A).
The mappings file of table B map all columns of table B to the right
property in javaClass (without mapping column name of table A).
I want to get list of object of type javaClass.
I tried: session.createSQLQuery ( "select B.*, A.name from A, B
where A.id = B.fk_id)
The problem is, how do I map column "name" from table A to member
"name" in the javaClass ?
Thanks,