I have a table that has a composite primary key
create table AuditLog
{
usrId varchar(16) not null,
lastUpdTm datetime not null,
msg varchar(266) null,
action int null,
....
constraint AuditLog_PK
PRIMARY KEY NONCLUSTERED (usrId, lastUpdTm)
}
Say I need to search all log record of a particular user.
So I would like to do something like this:
from AuditLog where usrId = 'abc123'
But this does not work because usrId is part of the composite key.
My question: how can get this done using Hibernate?
Any suggestion is greatly appreciated!
|