hibernate多表查询

SELECT a.id,a.name,a.email,a.inviteCode,a.createTime,a.lastChangeTime,b.domain
FROM User a join a.domain b WHERE a.id="+userId;

 

 

 

 

Hibernate:

select user0_.USER_ID as col_0_0_, user0_.USER_NAME as col_1_0_, user0_.EMAIL as col_2_0_, user0_.INVITE_CODE as col_3_0_, user0_.CREATE_TIME as col_4_0_, user0_.LAST_CHANGE_TIME as col_5_0_, domain1_.DOMAIN as col_6_0_ from WABI_USER user0_ inner join WABI_USER_DOMAIN domain1_ on user0_.USER_ID=domain1_.USER_ID where user0_.USER_ID=114

你可能感兴趣的:(Hibernate)