Hello everybody,
I have implemented audit logging as descripted here:
https://www.hibernate.org/48.htmlI want to get all entries after a specfic date, so I need to execute the following query
Code:
from User o
where o.auditInfo.lastUpdated >= '2010-03-15 00:00:00.0'
But I always get the exception
org.hibernate.QueryException: could not resolve property: lastUpdated of:
I mapped it as follows.
Code:
@Type(type = "com.xxx.audit.AuditInfoType")
@Columns(columns =
{
@Column(name = "lastUpdated", nullable = false),
@Column(name = "created", nullable = false) })
public AuditInfo getAuditInfo() {
return this.auditInfo;
}
public void setAuditInfo(AuditInfo auditInfo) {
this.auditInfo = auditInfo;
}
I also tried To map AuditInfo with @Embedded. Nothing works. Where is my error?
If I fetch an embedded id in this way everything works. Why not with the UserType?
Can somebody please help me?!
Thanks,
Till
Edit:
Code:
select o.auditInfo from User o
works fine