← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 22178: HibernateGenericStore. Removed dependency on SchemaService for now, caused unresolvable circular ...

 

------------------------------------------------------------
revno: 22178
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2016-03-08 09:34:43 +0100
message:
  HibernateGenericStore. Removed dependency on SchemaService for now, caused unresolvable circular dependency
modified:
  dhis-2/dhis-support/dhis-support-hibernate/src/main/java/org/hisp/dhis/hibernate/HibernateGenericStore.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== 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<AttributeValue> 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<AttributeValue> 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)";