Java 播放框架2.4播放增强程序问题
看起来Play Enhancer忽略了我为实体bean的一个字段创建的setter/getter,我无法理解为什么,会有什么问题?我已经一遍又一遍地阅读了文档,它解释说,如果该字段存在getter/setter,那么Play Enhancer不会生成自己的getter/setter。简单 plugins.sbt:Java 播放框架2.4播放增强程序问题,java,playframework,ebean,playframework-2.4,Java,Playframework,Ebean,Playframework 2.4,看起来Play Enhancer忽略了我为实体bean的一个字段创建的setter/getter,我无法理解为什么,会有什么问题?我已经一遍又一遍地阅读了文档,它解释说,如果该字段存在getter/setter,那么Play Enhancer不会生成自己的getter/setter。简单 plugins.sbt: addSbtPlugin("com.typesafe.sbt" % "sbt-play-enhancer" % "1.1.0"
addSbtPlugin("com.typesafe.sbt" % "sbt-play-enhancer" % "1.1.0")
实体类代码:
public static Finder<Long, MyEntityClass> find = new Finder<Long, MyEntityClass>(Long.class, MyEntityClass.class);
private BigDecimal unitPrice;
@Column(precision=7, scale=2)
public BigDecimal getUnitPrice() {
return unitPrice;
}
@Column(precision=7, scale=2)
public void setUnitPrice(BigDecimal unitPrice) {
if (unitPrice == null) {
this.unitPrice = unitPrice;
}
else {
this.unitPrice = unitPrice.setScale(2, BigDecimal.ROUND_HALF_UP);
}
}
我会错过什么
在我看来,下一步要做的是检查Play Enhancer源代码、测试和调试,通过将其提供给我的类来生成代码,但我在Scala方面的技能太低,无法在可接受的时间内完成
private java.math.BigDecimal unitPrice;
@javax.persistence.Column(precision = 7, scale = 2)
public java.math.BigDecimal getUnitPrice() { /* compiled code */ }
@javax.persistence.Column(precision = 7, scale = 2)
public void setUnitPrice(java.math.BigDecimal unitPrice) { /* compiled code */ }
protected java.math.BigDecimal _ebean_get_unitPrice() { /* compiled code */ }
protected void _ebean_set_unitPrice(java.math.BigDecimal newValue) { /* compiled code */ }
protected java.math.BigDecimal _ebean_getni_unitPrice() { /* compiled code */ }
protected void _ebean_setni_unitPrice(java.math.BigDecimal _newValue) { /* compiled code */ }