如何在java中将DataInput转换为DataInputStream?我需要知道DataInput的大小.
我有两个实体:
User
{
UserGuid,
Address,
.
.
.
EmailCount // This is not a column in the database,
// I just wanna get the count number from the UserEmail table
// and map the value to this property
}
UserEmail
{
UserGuid,
Timestamp
}
Run Code Online (Sandbox Code Playgroud)
问题是如何通过NHibernate中的子查询获取电子邮件数量?
到目前为止我有这个,但它不起作用.任何的想法?
User userEntity = null;
var subQuery = QueryOver.Of<UserEmail>()
.Where(ue => ue.UserGuid == userEntity.UserGuid)
.ToRowCountQuery();
return _session.StatefulSession.QueryOver(() => userEntity)
.WithSubquery.WhereValue("EmailCount").Eq(subQuery)
.List();
Run Code Online (Sandbox Code Playgroud)