Subversion Repositories general

Compare Revisions

Ignore whitespace Rev 1018 → Rev 1019

/hostadmiral/trunk/src/ak/hostadmiral/core/model/MailboxManager.java
134,7 → 134,7
try {
List list = HibernateUtil.currentSession().find(
"select mb from Mailbox mb left join fetch mb.domain as d"
+ " left join fetch mb.owner where mb.login=?",
+ " left join fetch mb.owner left join fetch mb.systemUser where mb.login=?",
login, Hibernate.STRING);
 
if(list.size() == 0)
287,18 → 287,18
if(editor.isSuperuser())
return HibernateUtil.currentSession().find(
"select mb from Mailbox mb left join fetch mb.domain as d"
+ " left join fetch mb.owner");
+ " left join fetch mb.owner left join fetch mb.systemUser");
else
// FIXME: any problems for big lists or by pages?
return CollectionUtils.addUnique(
HibernateUtil.currentSession().find(
"select mb from Mailbox mb left join fetch mb.domain as d"
+ " left join fetch mb.owner"
+ " left join fetch mb.owner left join fetch mb.systemUser"
+ " where mb.owner=?",
new Object[] { editor }, new Type[] { Hibernate.entity(User.class) } ),
HibernateUtil.currentSession().find(
" select mb from Mailbox mb left join fetch mb.domain as d"
+ " left join fetch mb.owner"
+ " left join fetch mb.owner left join fetch mb.systemUser"
+ " where d.owner=?",
new Object[] { editor }, new Type[] { Hibernate.entity(User.class) } ));
}
339,7 → 339,8
 
try {
mailboxes = HibernateUtil.currentSession().find(
"select mb from Mailbox mb left join fetch mb.domain where mb.owner = ?",
"select mb from Mailbox mb left join fetch mb.domain"
+ " left join fetch mb.systemUser where mb.owner = ?",
user, Hibernate.entity(User.class) );
}
catch(HibernateException ex)
357,7 → 358,8
 
try {
mailboxes = HibernateUtil.currentSession().find(
"select mb from Mailbox mb left join fetch mb.domain where mb.owner = ?",
"select mb from Mailbox mb left join fetch mb.domain"
+ " left join fetch mb.systemUser where mb.owner = ?",
user, Hibernate.entity(User.class) );
}
catch(HibernateException ex)
377,7 → 379,8
 
try {
mailboxes = HibernateUtil.currentSession().find(
"select mb from Mailbox mb left join fetch mb.owner where mb.domain = ?",
"select mb from Mailbox mb left join fetch mb.owner"
+ " left join fetch mb.systemUser where mb.domain = ?",
domain, Hibernate.entity(InetDomain.class) );
}
catch(HibernateException ex)
395,7 → 398,8
 
try {
mailboxes = HibernateUtil.currentSession().find(
"select mb from Mailbox mb left join fetch mb.owner where mb.domain = ?",
"select mb from Mailbox mb left join fetch mb.owner"
+ " left join fetch mb.systemUser where mb.domain = ?",
domain, Hibernate.entity(InetDomain.class) );
}
catch(HibernateException ex)
415,7 → 419,7
 
try {
mailboxes = HibernateUtil.currentSession().find(
"select mb from Mailbox mb left join fetch mb.domain as d"
"select mb from Mailbox mb left join fetch mb.domain"
+ " left join fetch mb.owner where mb.systemUser = ?",
user, Hibernate.entity(SystemUser.class) );
}
434,7 → 438,7
 
try {
mailboxes = HibernateUtil.currentSession().find(
"select mb from Mailbox mb left join fetch mb.domain as d"
"select mb from Mailbox mb left join fetch mb.domain"
+ " left join fetch mb.owner where mb.systemUser = ?",
user, Hibernate.entity(SystemUser.class) );
}