Java postgresql正在查找错误的列名
开发一个由postgresql数据库支持的Spring应用程序 遇到了严重问题,必须重建数据库。这似乎对develope有效,但对我的生产托管数据库无效 当试图检索实体时,它会查找一个不存在且实体未定义它的列。看起来它正在寻找已经不存在的非常旧的代码,而这些代码对于Postgre来说首先是有问题的 这是我得到的Java postgresql正在查找错误的列名,java,spring,postgresql,hibernate,jpa,Java,Spring,Postgresql,Hibernate,Jpa,开发一个由postgresql数据库支持的Spring应用程序 遇到了严重问题,必须重建数据库。这似乎对develope有效,但对我的生产托管数据库无效 当试图检索实体时,它会查找一个不存在且实体未定义它的列。看起来它正在寻找已经不存在的非常旧的代码,而这些代码对于Postgre来说首先是有问题的 这是我得到的 org.postgresql.util.PSQLException:错误:列harvestite0\uU0.name不存在 这是引用中的实体 @Entity public class H
org.postgresql.util.PSQLException:错误:列harvestite0\uU0.name不存在
这是引用中的实体
@Entity
public class HarvestItem {
@Id
@Column(name = "id", nullable = false)
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private Integer hType;
@Column(name = "title")
private String title;
@JsonManagedReference(value = "harvest-item-inventory-items")
@OneToMany(mappedBy = "harvestItem", targetEntity = InventoryItem.class)
private List<InventoryItem> inventoryItems;
// Autogen Get-Set
public Integer getId() {
return id;
}
public List<InventoryItem> getInventoryItems() {
return inventoryItems;
}
public void setInventoryItems(List<InventoryItem> inventoryItems) {
this.inventoryItems = inventoryItems;
}
public Integer gethType() {
return hType;
}
public void sethType(Integer hType) {
this.hType = hType;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
}
@实体
公共类项目{
@身份证
@列(name=“id”,nullable=false)
@GeneratedValue(策略=GenerationType.IDENTITY)
私有整数id;
私有整数类型;
@列(name=“title”)
私有字符串标题;
@JsonManagedReference(value=“收获项目库存项目”)
@OneToMany(mappedBy=“harvestItem”,targetEntity=InventoryItem.class)
私人清单清单项目;
//自动生成设置
公共整数getId(){
返回id;
}
公共列表getInventoryItems(){
归还库存物品;
}
公共无效集合inventoryItems(列出inventoryItems){
this.inventoryItems=inventoryItems;
}
公共整数gethType(){
返回hType;
}
公共void sethType(整数hType){
this.hType=hType;
}
公共字符串getTitle(){
返回标题;
}
公共无效集合标题(字符串标题){
this.title=标题;
}
}
这是harvest item实体的存储库
package harvest.repositories;
import harvest.entities.HarvestItem;
import org.springframework.data.repository.CrudRepository;
import java.util.List;
public interface HarvestItemRepository extends CrudRepository<HarvestItem, Integer> {
List<HarvestItem> findByTitle(String title);
}
package harvest.repositories;
导入harvest.entities.HarvestItem;
导入org.springframework.data.repository.crudepository;
导入java.util.List;
公共接口HarvestItemRepository扩展了Crudepository{
列表FindBytle(字符串标题);
}
也许您的HarvestItem类中有public getter,jpa尝试填充该字段,但不存在该错误的确切时间,您能提供更多上下文吗?您确定要部署最新版本吗?您是否使用任何数据库更改管理工具?