【发布时间】:2014-07-25 16:01:06
【问题描述】:
这些是我正在使用的框架:spring MVC 3.2.3、Roo 1.2.4 和 ava 1.7。
我在 Item 域中添加了一个 Transient 字段,如下所示:
@Transient
private Long hierarchyNbr;
在保存实体时
entityRepository.saveAndFlush(obj)
我收到以下异常:
休眠: 插入 进入 dbo.Item (CreateTs、CreateUser、Descr、ForAnyCompanyInd、hierarchyNbr、IdIndustry、IdUom、IsClassifiedInd、IsParentInd、LastUpdateTs、LastUpdateUser) 价值观 (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) 2014-07-25 10:48:09,580 [http-bio-8080-exec-9] 错误 org.hibernate.engine.jdbc.spi.SqlExceptionHelper - 列名“hierarchyNbr”无效。
根据我的理解 hierarchyNbr 字段应该不被持久化,不是吗?
那么,有人可以帮我处理这个案子吗?
【问题讨论】:
-
@Transient使用的导入是什么? -
我的域对象中需要一个不会被持久化的字段,而这不在表格中。
-
对不起这里是:org.springframework.data.annotation.Transient
标签: hibernate spring-mvc jpa spring-roo spring-data-jpa