/hostadmiral/trunk/src/ak/hostadmiral/core/model/InetDomainManager.java |
---|
267,10 → 267,12 |
{ |
try { |
if(editor.isSuperuser()) |
return HibernateUtil.currentSession().find("from InetDomain"); |
return HibernateUtil.currentSession().find( |
"select d from InetDomain d left join fetch d.owner"); |
else |
return HibernateUtil.currentSession().find( |
"from InetDomain where owner=?", editor, Hibernate.entity(User.class)); |
"select d from InetDomain d left join fetch d.owner where d.owner=?", |
editor, Hibernate.entity(User.class)); |
} |
catch(HibernateException ex) |
{ |
/hostadmiral/trunk/src/ak/hostadmiral/core/model/MailboxManager.java |
---|
3,6 → 3,7 |
import java.util.*; |
import net.sf.hibernate.*; |
import net.sf.hibernate.type.Type; |
import ak.hostadmiral.util.CollectionUtils; |
import ak.hostadmiral.util.HibernateUtil; |
import ak.hostadmiral.util.ModelException; |
import ak.hostadmiral.util.ModelSecurityException; |
282,13 → 283,22 |
{ |
try { |
if(editor.isSuperuser()) |
return HibernateUtil.currentSession().find("from Mailbox"); |
return HibernateUtil.currentSession().find( |
"select mb from Mailbox mb left join fetch mb.domain as d" |
+ " left join fetch mb.owner"); |
else |
return HibernateUtil.currentSession().find( |
"select mb from Mailbox mb left join mb.domain as d" |
+ " where d.owner=? or mb.owner=?", |
new Object[] { editor, editor }, |
new Type[] { Hibernate.entity(User.class), Hibernate.entity(User.class) } ); |
// 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" |
+ " 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" |
+ " where d.owner=?", |
new Object[] { editor }, new Type[] { Hibernate.entity(User.class) } )); |
} |
catch(HibernateException ex) |
{ |
/hostadmiral/trunk/src/ak/hostadmiral/core/model/MailAliasManager.java |
---|
3,6 → 3,7 |
import java.util.*; |
import net.sf.hibernate.*; |
import net.sf.hibernate.type.Type; |
import ak.hostadmiral.util.CollectionUtils; |
import ak.hostadmiral.util.HibernateUtil; |
import ak.hostadmiral.util.ModelException; |
import ak.hostadmiral.util.ModelSecurityException; |
276,11 → 277,17 |
if(editor.isSuperuser()) |
return HibernateUtil.currentSession().find("from MailAlias"); |
else |
return HibernateUtil.currentSession().find( |
"select a from MailAlias a left join a.domain as d" |
+ " where d.owner=? or a.owner=?", |
new Object[] { editor, editor }, |
new Type[] { Hibernate.entity(User.class), Hibernate.entity(User.class) } ); |
return CollectionUtils.addUnique( |
HibernateUtil.currentSession().find( |
"select a from MailAlias a left join fetch a.domain as d" |
+ " left join fetch a.owner" |
+ " where d.owner=?", |
new Object[] { editor }, new Type[] { Hibernate.entity(User.class) } ), |
HibernateUtil.currentSession().find( |
"select a from MailAlias a left join fetch a.domain as d" |
+ " left join fetch a.owner" |
+ " where a.owner=?", |
new Object[] { editor }, new Type[] { Hibernate.entity(User.class) } )); |
} |
catch(HibernateException ex) |
{ |
/hostadmiral/trunk/src/ak/hostadmiral/core/model/Mailbox.java |
---|
106,7 → 106,7 |
/** |
* |
* @hibernate.set cascade="all" |
* @hibernate.set cascade="all" lazy="true" |
* @hibernate.collection-key column="obj" |
* @hibernate.collection-one-to-many class="ak.hostadmiral.core.model.PasswordStoreAbstract" |
*/ |
/hostadmiral/trunk/src/ak/hostadmiral/core/model/MailAlias.java |
---|
113,7 → 113,7 |
/** |
* @return Collection(MailAliasDestination) |
* |
* @hibernate.bag inverse="true" cascade="all-delete-orphan" |
* @hibernate.bag inverse="true" cascade="all-delete-orphan" lazy="true" |
* @hibernate.collection-key column="alias" |
* @hibernate.collection-one-to-many class="ak.hostadmiral.core.model.MailAliasDestination" |
*/ |
/hostadmiral/trunk/src/ak/hostadmiral/core/model/User.java |
---|
152,7 → 152,7 |
/** |
* |
* @hibernate.set cascade="all" |
* @hibernate.set cascade="all" lazy="true" |
* @hibernate.collection-key column="obj" |
* @hibernate.collection-one-to-many class="ak.hostadmiral.core.model.PasswordStoreAbstract" |
*/ |