'字段列表'gwt项目中的未知列'... jdoDetachedState' [英] Unknown column '...jdoDetachedState' in 'field list' gwt project
问题描述
PM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
WARN:SQL错误:1054,SQLState:42S22
PM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
错误:'字段列表'中的未知列'employee0_.jdoDetachedState'
我完成了这个
列表< Employee> list = session.createQuery(FROM Employee)。list();
我的查询看起来像:
<$ p $ h
选择
employee0_.id作为id1_1_,
employee0_.born as born2_1_,
employee0_.department as departme3_1_,
employee0_ 。first_name as first_na4_1_,
employee0_.jdoDetachedState as jdoDetac5_1_,
employee0_.post as post8_1_,
employee0_.salary as salary6_1_,
employee0_.second_name as second_n7_1_ $ b $ from
员工employee0_
和我的课程外观
@Entity
@Table(name =employee)
public class Employee实现Serializable {
@Id
public Integer id;
@Column(nullable = false)
public String first_name;
@Column(nullable = false)
public String second_name;
@OneToOne
@JoinColumn(name =post)
公共职位发布;
@Column(nullable = false)
public String born;
@Column(nullable = false)
public Integer工资;
public String department;
public Employee(){}
$ b $ ... public getters and setters
}
其他查询可行,但这不行。我找到了 https://stackoverflow.com/questions/ 16319853 / unexpected-jdodetachedstate-column-when-using-hibernate-in-gwt-project ,但无法理解它是如何提供帮助的。
我遇到了同样的问题,我在这个网站添加以下几行:
@Transient
保护对象[] jdoDetachedState;
这对我有帮助。也许,这会帮助任何人。
I have strange problems. When I ran my project without gwt, just hibernate - all is ok, but when I insert it code in gwt, this exception became appear.
PM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
WARN: SQL Error: 1054, SQLState: 42S22
PM org.hibernate.engine.jdbc.spi.SqlExceptionHelper logExceptions
ERROR: Unknown column 'employee0_.jdoDetachedState' in 'field list'
I done this
List<Employee> list = session.createQuery("FROM Employee").list();
My query look like:
Hibernate:
select
employee0_.id as id1_1_,
employee0_.born as born2_1_,
employee0_.department as departme3_1_,
employee0_.first_name as first_na4_1_,
employee0_.jdoDetachedState as jdoDetac5_1_,
employee0_.post as post8_1_,
employee0_.salary as salary6_1_,
employee0_.second_name as second_n7_1_
from
employee employee0_
and my class look
@Entity
@Table(name="employee")
public class Employee implements Serializable{
@Id
public Integer id;
@Column(nullable=false)
public String first_name;
@Column(nullable=false)
public String second_name;
@OneToOne
@JoinColumn(name = "post")
public Position post;
@Column(nullable=false)
public String born;
@Column(nullable=false)
public Integer salary;
public String department;
public Employee(){}
... public getters and setters
}
Other query works, but this don't. I've found https://stackoverflow.com/questions/16319853/unexpected-jdodetachedstate-column-when-using-hibernate-in-gwt-project but can't inderstand how it can help.
I've had the same problem and I've got solution at this web-site with adding these lines:
@Transient
protected Object[] jdoDetachedState;
This helped for me. Maybe, this will help anybody.
这篇关于'字段列表'gwt项目中的未知列'... jdoDetachedState'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!