=== modified file 'dhis-2/dhis-support/dhis-support-hibernate/src/main/java/org/hisp/dhis/hibernate/HibernateGenericStore.java' --- dhis-2/dhis-support/dhis-support-hibernate/src/main/java/org/hisp/dhis/hibernate/HibernateGenericStore.java 2016-02-18 14:45:25 +0000 +++ dhis-2/dhis-support/dhis-support-hibernate/src/main/java/org/hisp/dhis/hibernate/HibernateGenericStore.java 2016-03-08 08:34:43 +0000 @@ -54,8 +54,6 @@ import org.hisp.dhis.hibernate.exception.ReadAccessDeniedException; import org.hisp.dhis.hibernate.exception.UpdateAccessDeniedException; import org.hisp.dhis.interpretation.Interpretation; -import org.hisp.dhis.schema.Schema; -import org.hisp.dhis.schema.SchemaService; import org.hisp.dhis.security.acl.AccessStringHelper; import org.hisp.dhis.security.acl.AclService; import org.hisp.dhis.user.CurrentUserService; @@ -93,9 +91,6 @@ @Autowired protected CurrentUserService currentUserService; - @Autowired - protected SchemaService schemaService; - /** * Allows injection (e.g. by a unit test) */ @@ -564,13 +559,6 @@ @SuppressWarnings( "unchecked" ) public T getByAttribute( Attribute attribute ) { - Schema schema = schemaService.getDynamicSchema( getClazz() ); - - if ( schema == null || !schema.havePersistedProperty( "attributeValues" ) ) - { - return null; - } - Criteria criteria = getCriteria(); criteria.createAlias( "attributeValues", "av" ); criteria.add( Restrictions.eq( "av.attribute", attribute ) ); @@ -582,13 +570,6 @@ @SuppressWarnings( "unchecked" ) public List getAttributeValueByAttribute( Attribute attribute ) { - Schema schema = schemaService.getDynamicSchema( getClazz() ); - - if ( schema == null || !schema.havePersistedProperty( "attributeValues" ) ) - { - return null; - } - String hql = "select av from " + getClazz().getSimpleName() + " as e " + "inner join e.attributeValues av inner join av.attribute at where at = :attribute )"; @@ -599,13 +580,6 @@ @SuppressWarnings( "unchecked" ) public List getAttributeValueByAttributeAndValue( Attribute attribute, String value ) { - Schema schema = schemaService.getDynamicSchema( getClazz() ); - - if ( schema == null || !schema.havePersistedProperty( "attributeValues" ) ) - { - return null; - } - String hql = "select av from " + getClazz().getSimpleName() + " as e " + "inner join e.attributeValues av inner join av.attribute at where at = :attribute and av.value = :value)";