Hello,
I'm trying to execute a simple HQL query with JOIN:
Code:
SELECT title FROM Post p JOIN p.title title
where the Post entity is:
Code:
@Entity
public class Post
{
private long id;
private String title;
public Post()
{
}
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
public long getId()
{
return id;
}
public void setId(long id)
{
this.id = id;
}
@Column
public String getTitle()
{
return title;
}
public void setTitle(String title)
{
this.title = title;
}
}
But I got an exception:
Quote:
java.lang.NullPointerException
at org.hibernate.hql.ast.HqlSqlWalker.createFromJoinElement(HqlSqlWalker.java:391)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.joinElement(HqlSqlBaseWalker.java:3671)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElement(HqlSqlBaseWalker.java:3452)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromElementList(HqlSqlBaseWalker.java:3325)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.fromClause(HqlSqlBaseWalker.java:733)
Is it possible to create JOIN for a single valued property or this feature is unsupported? I use Hibernate 3.6.0. Thanks.