某中间表的POJO,声明了PK @PK({"userId, msId"})
package com.gree.sg.common.pojos;
import org.nutz.dao.entity.annotation.*;
@Table("a_user_micro_service")
@PK({"userId, msId"})
public class UserMicroService {
@Column("user_id")
@ColDefine(type = ColType.CHAR, width = 16 )
private String userId;
@Column("ms_id")
@ColDefine(type = ColType.CHAR, width = 16 )
private String msId;
public UserMicroService() {
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getMsId() {
return msId;
}
public void setMsId(String msId) {
this.msId = msId;
}
}
使用 dao.create生成表
dao.create(UserMicroService.class, true);
生成的SQL,没有带主键的
CREATE TABLE a_user_micro_service(
user_id CHAR(16),
ms_id CHAR(16)) ENGINE=InnoDB CHARSET=utf8
求解??