java.sql.SQLException: 列名 'dtype' 无效。 20
使用JPA实体继承关系时出现此错误父类:@MappedSuperclasspublicclassCodeCaption{@Id@GeneratedValue(strate...
使用JPA实体继承关系时出现此错误
父类:
@MappedSuperclass
public class CodeCaption {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="code")
protected String code;
@Column(name="caption")
protected String caption;
//get/set.....
子类:
@Entity
@Table(name="t_code_audit_status")
@Cache(usage=CacheConcurrencyStrategy.NONSTRICT_READ_WRITE, region="com.jxufe.oec.entity.codecaption.CodeAuditStatus")
public class CodeAuditStatus extends CodeCaption implements Serializable{
private static final long serialVersionUID = -9118769983650158685L;
}
DAO层使用Data JPA :
public interface CodeAuditStatusDao extends JpaRepository<CodeAuditStatus, String>, JpaSpecificationExecutor<CodeAuditStatus>{
}
测试查询方法:
List<CodeAuditStatus> list=cAuditStatusDao.findAll();
print(list.size()); 展开
父类:
@MappedSuperclass
public class CodeCaption {
@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name="code")
protected String code;
@Column(name="caption")
protected String caption;
//get/set.....
子类:
@Entity
@Table(name="t_code_audit_status")
@Cache(usage=CacheConcurrencyStrategy.NONSTRICT_READ_WRITE, region="com.jxufe.oec.entity.codecaption.CodeAuditStatus")
public class CodeAuditStatus extends CodeCaption implements Serializable{
private static final long serialVersionUID = -9118769983650158685L;
}
DAO层使用Data JPA :
public interface CodeAuditStatusDao extends JpaRepository<CodeAuditStatus, String>, JpaSpecificationExecutor<CodeAuditStatus>{
}
测试查询方法:
List<CodeAuditStatus> list=cAuditStatusDao.findAll();
print(list.size()); 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询