MiddleGen中配置hibernate的many to many属性

MiddleGen中配置hibernate的many to many属性
key words: MiddleGen,hibernate,many to many,多对多

如果你有如下表结构

user(user_id,user_name)
role(role_id,role_name)

user_role(id,user_id,role_id)

那么默认MiddleGen生成的是两个一对多,但我们更多的情况是用many to many

需要修改middlegen的build.xml文件

< many2many >
            
< tablea  generate ="true"  name ="user" />
            
< jointable  name ="user_role"  generate ="false" />
            
< tableb  generate ="true"  name ="role" />
         
</ many2many >

你可能感兴趣的:(MiddleGen中配置hibernate的many to many属性)