小编ser*_*erg的帖子

scala hibernate/jpa - 忽略自动生成的位图$ init $ 0映射

试着用scala来使用hibernate/jpa.遇到有趣的问题.

这是我的实体定义.

@Entity
class Product(n: String, d: Double) extends EntityBase {

  def this() = this("", 0)
  def this(n: String) = this(n, 0)

  var name: String = n
  var price: Double = d

  @ManyToOne
  @JoinColumn(name="orderId")
  var order: Order = _

  override def toString = "Product: " + id + " " + name
}
Run Code Online (Sandbox Code Playgroud)

当我运行hibernate查询时,我得到以下异常:

[SQLGrammarException: ERROR: column this_.bitmap$init$0 does not exist Position: 29]
Run Code Online (Sandbox Code Playgroud)

显然,jpa默认为scala自动生成的字段位图$ init $ 0创建映射.我不知道导致scala生成它的原因.但无论有没有任何解决方案告诉jpa忽略它?或者以某种方式将其从hibernate映射中删除?或者别的什么..

hibernate jpa scala

6
推荐指数
1
解决办法
500
查看次数

标签 统计

hibernate ×1

jpa ×1

scala ×1