Search in sources :

Example 21 with MasterDataEntity

use of org.mifos.application.master.business.MasterDataEntity in project head by mifos.

the class PenaltyDaoHibernate method doFetchListOfMasterDataFor.

@SuppressWarnings("unchecked")
private <T extends MasterDataEntity> List<T> doFetchListOfMasterDataFor(Class<T> type) {
    Session session = StaticHibernateUtil.getSessionTL();
    List<T> masterEntities = session.createQuery("from " + type.getName()).list();
    for (MasterDataEntity masterData : masterEntities) {
        Hibernate.initialize(masterData.getNames());
    }
    return masterEntities;
}
Also used : MasterDataEntity(org.mifos.application.master.business.MasterDataEntity) Session(org.hibernate.Session)

Aggregations

MasterDataEntity (org.mifos.application.master.business.MasterDataEntity)21 Session (org.hibernate.Session)7 Test (org.junit.Test)5 ClassMetadata (org.hibernate.metadata.ClassMetadata)4 ComponentType (org.hibernate.type.ComponentType)4 Type (org.hibernate.type.Type)4 PersonnelLevelEntity (org.mifos.customers.personnel.business.PersonnelLevelEntity)4 PersonnelStatusEntity (org.mifos.customers.personnel.business.PersonnelStatusEntity)4 AbstractBusinessObject (org.mifos.framework.business.AbstractBusinessObject)4 ArrayList (java.util.ArrayList)3 GLCodeEntity (org.mifos.accounts.financial.business.GLCodeEntity)3 MessageLookup (org.mifos.application.master.MessageLookup)3 MeetingBO (org.mifos.application.meeting.business.MeetingBO)3 Calendar (java.util.Calendar)2 Date (java.util.Date)2 Iterator (java.util.Iterator)2 List (java.util.List)2 Set (java.util.Set)2 FeeBO (org.mifos.accounts.fees.business.FeeBO)2 FeeDto (org.mifos.accounts.fees.business.FeeDto)2