dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #21663
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 10312: Camel-case method names
------------------------------------------------------------
revno: 10312
committer: Lars Helge Øverland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2013-03-19 13:45:37 +0100
message:
Camel-case method names
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 2013-03-19 12:34:36 +0000
+++ dhis-2/dhis-support/dhis-support-hibernate/src/main/java/org/hisp/dhis/hibernate/HibernateGenericStore.java 2013-03-19 12:45:37 +0000
@@ -275,7 +275,7 @@
return object;
}
-
+
@Override
@SuppressWarnings("unchecked")
public final T load( int id )
@@ -366,12 +366,12 @@
@SuppressWarnings("unchecked")
public final List<T> getAll()
{
- Query query = sharingEnabled() ? getQueryAllACL() : getQueryAll();
+ Query query = sharingEnabled() ? getQueryAllAcl() : getQueryAll();
return query.list();
}
- private Query getQueryAllACL()
+ private Query getQueryAllAcl()
{
String hql = "select distinct c from " + clazz.getName() + " c"
+ " where c.publicAccess like 'r%' or c.user IS NULL or c.user=:user"
@@ -393,12 +393,12 @@
@SuppressWarnings("unchecked")
public List<T> getAllEqName( String name )
{
- Query query = sharingEnabled() ? getQueryAllEqNameACL( name ) : getQueryAllEqName( name );
+ Query query = sharingEnabled() ? getQueryAllEqNameAcl( name ) : getQueryAllEqName( name );
return query.list();
}
- private Query getQueryAllEqNameACL( String name )
+ private Query getQueryAllEqNameAcl( String name )
{
String hql = "select distinct c from " + clazz.getName() + " c"
+ " where name = :name and ( c.publicAccess like 'r%' or c.user IS NULL or c.user=:user"
@@ -425,12 +425,12 @@
@SuppressWarnings("unchecked")
public List<T> getAllEqNameIgnoreCase( String name )
{
- Query query = sharingEnabled() ? getQueryAllEqNameACLIgnoreCase( name ) : getQueryAllEqNameIgnoreCase( name );
+ Query query = sharingEnabled() ? getQueryAllEqNameAclIgnoreCase( name ) : getQueryAllEqNameIgnoreCase( name );
return query.list();
}
- private Query getQueryAllEqNameACLIgnoreCase( String name )
+ private Query getQueryAllEqNameAclIgnoreCase( String name )
{
String hql = "select distinct c from " + clazz.getName() + " c"
+ " where lower(name) = :name and ( c.publicAccess like 'r%' or c.user IS NULL or c.user=:user"
@@ -457,12 +457,12 @@
@SuppressWarnings("unchecked")
public List<T> getAllEqShortName( String shortName )
{
- Query query = sharingEnabled() ? getQueryAllEqShortNameACL( shortName ) : getQueryAllEqShortName( shortName );
+ Query query = sharingEnabled() ? getQueryAllEqShortNameAcl( shortName ) : getQueryAllEqShortName( shortName );
return query.list();
}
- private Query getQueryAllEqShortNameACL( String shortName )
+ private Query getQueryAllEqShortNameAcl( String shortName )
{
String hql = "select distinct c from " + clazz.getName() + " c"
+ " where shortName = :shortName and ( c.publicAccess like 'r%' or c.user IS NULL or c.user=:user"
@@ -489,12 +489,12 @@
@SuppressWarnings("unchecked")
public List<T> getAllEqShortNameIgnoreCase( String shortName )
{
- Query query = sharingEnabled() ? getQueryAllEqShortNameACLIgnoreCase( shortName ) : getQueryAllEqShortNameIgnoreCase( shortName );
+ Query query = sharingEnabled() ? getQueryAllEqShortNameAclIgnoreCase( shortName ) : getQueryAllEqShortNameIgnoreCase( shortName );
return query.list();
}
- private Query getQueryAllEqShortNameACLIgnoreCase( String shortName )
+ private Query getQueryAllEqShortNameAclIgnoreCase( String shortName )
{
String hql = "select distinct c from " + clazz.getName() + " c"
+ " where lower(shortName) = :shortName and ( c.publicAccess like 'r%' or c.user IS NULL or c.user=:user"
@@ -521,12 +521,12 @@
@SuppressWarnings("unchecked")
public List<T> getAllLikeName( String name )
{
- Query query = sharingEnabled() ? getQueryAllLikeNameACL( name ) : getQueryAllLikeName( name );
+ Query query = sharingEnabled() ? getQueryAllLikeNameAcl( name ) : getQueryAllLikeName( name );
return query.list();
}
- private Query getQueryAllLikeNameACL( String name )
+ private Query getQueryAllLikeNameAcl( String name )
{
String hql = "select distinct c from " + clazz.getName() + " c"
+ " where lower(name) like :name and ( c.publicAccess like 'r%' or c.user IS NULL or c.user=:user"
@@ -553,12 +553,12 @@
@SuppressWarnings("unchecked")
public final List<T> getAllOrderedName()
{
- Query query = sharingEnabled() ? getQueryAllOrderedNameACL() : getQueryAllOrderedName();
+ Query query = sharingEnabled() ? getQueryAllOrderedNameAcl() : getQueryAllOrderedName();
return query.list();
}
- private Query getQueryAllOrderedNameACL()
+ private Query getQueryAllOrderedNameAcl()
{
String hql = "select distinct c from " + clazz.getName() + " c"
+ " where c.publicAccess like 'r%' or c.user IS NULL or c.user=:user"
@@ -581,7 +581,7 @@
@SuppressWarnings("unchecked")
public List<T> getAllOrderedName( int first, int max )
{
- Query query = sharingEnabled() ? getQueryAllOrderedNameACL() : getQueryAllOrderedName();
+ Query query = sharingEnabled() ? getQueryAllOrderedNameAcl() : getQueryAllOrderedName();
query.setFirstResult( first );
query.setMaxResults( max );
@@ -593,7 +593,7 @@
@SuppressWarnings("unchecked")
public List<T> getAllOrderedLastUpdated( int first, int max )
{
- Query query = sharingEnabled() ? getQueryAllOrderedLastUpdatedACL() : getQueryAllOrderedLastUpdated();
+ Query query = sharingEnabled() ? getQueryAllOrderedLastUpdatedAcl() : getQueryAllOrderedLastUpdated();
query.setFirstResult( first );
query.setMaxResults( max );
@@ -601,7 +601,7 @@
return query.list();
}
- private Query getQueryAllOrderedLastUpdatedACL()
+ private Query getQueryAllOrderedLastUpdatedAcl()
{
String hql = "select distinct c from " + clazz.getName() + " c"
+ " where c.publicAccess like 'r%' or c.user IS NULL or c.user=:user"
@@ -624,7 +624,7 @@
@SuppressWarnings("unchecked")
public List<T> getAllLikeNameOrderedName( String name, int first, int max )
{
- Query query = sharingEnabled() ? getQueryAllLikeNameOrderedNameACL( name ) : getQueryAllLikeNameOrderedName( name );
+ Query query = sharingEnabled() ? getQueryAllLikeNameOrderedNameAcl( name ) : getQueryAllLikeNameOrderedName( name );
query.setFirstResult( first );
query.setMaxResults( max );
@@ -632,7 +632,7 @@
return query.list();
}
- private Query getQueryAllLikeNameOrderedNameACL( String name )
+ private Query getQueryAllLikeNameOrderedNameAcl( String name )
{
String hql = "select distinct c from " + clazz.getName() + " c"
+ " where lower(c.name) like :name and ( c.publicAccess like 'r%' or c.user IS NULL or c.user=:user"
@@ -658,12 +658,12 @@
@Override
public int getCount()
{
- Query query = sharingEnabled() ? getQueryCountACL() : getQueryCount();
+ Query query = sharingEnabled() ? getQueryCountAcl() : getQueryCount();
return ((Long) query.uniqueResult()).intValue();
}
- private Query getQueryCountACL()
+ private Query getQueryCountAcl()
{
String hql = "select count(distinct c) from " + clazz.getName() + " c"
+ " where c.publicAccess like 'r%' or c.user IS NULL or c.user=:user"
@@ -684,12 +684,12 @@
@Override
public int getCountLikeName( String name )
{
- Query query = sharingEnabled() ? getQueryCountLikeNameACL( name ) : getQueryCountLikeName( name );
+ Query query = sharingEnabled() ? getQueryCountLikeNameAcl( name ) : getQueryCountLikeName( name );
return ((Long) query.uniqueResult()).intValue();
}
- private Query getQueryCountLikeNameACL( String name )
+ private Query getQueryCountLikeNameAcl( String name )
{
String hql = "select count(distinct c) from " + clazz.getName() + " c"
+ " where lower(name) like :name and (c.publicAccess like 'r%' or c.user IS NULL or c.user=:user"
@@ -715,12 +715,12 @@
@Override
public long getCountGeLastUpdated( Date lastUpdated )
{
- Query query = sharingEnabled() ? getQueryCountGeLastUpdatedACL( lastUpdated ) : getQueryCountGeLastUpdated( lastUpdated );
+ Query query = sharingEnabled() ? getQueryCountGeLastUpdatedAcl( lastUpdated ) : getQueryCountGeLastUpdated( lastUpdated );
return ((Long) query.uniqueResult()).intValue();
}
- private Query getQueryCountGeLastUpdatedACL( Date lastUpdated )
+ private Query getQueryCountGeLastUpdatedAcl( Date lastUpdated )
{
String hql = "select count(distinct c) from " + clazz.getName() + " c"
+ " where c.lastUpdated >= :lastUpdated and (c.publicAccess like 'r%' or c.user IS NULL or c.user=:user"
@@ -747,12 +747,12 @@
@SuppressWarnings("unchecked")
public List<T> getAllGeLastUpdated( Date lastUpdated )
{
- Query query = sharingEnabled() ? getQueryAllGeLastUpdatedACL( lastUpdated ) : getQueryAllGeLastUpdated( lastUpdated );
+ Query query = sharingEnabled() ? getQueryAllGeLastUpdatedAcl( lastUpdated ) : getQueryAllGeLastUpdated( lastUpdated );
return query.list();
}
- private Query getQueryAllGeLastUpdatedACL( Date lastUpdated )
+ private Query getQueryAllGeLastUpdatedAcl( Date lastUpdated )
{
String hql = "select distinct c from " + clazz.getName() + " c"
+ " where c.lastUpdated >= :lastUpdated and ( c.publicAccess like 'r%' or c.user IS NULL or c.user=:user"
@@ -779,12 +779,12 @@
@SuppressWarnings("unchecked")
public List<T> getAllGeCreated( Date created )
{
- Query query = sharingEnabled() ? getQueryAllGeCreatedACL( created ) : getQueryAllGeCreated( created );
+ Query query = sharingEnabled() ? getQueryAllGeCreatedAcl( created ) : getQueryAllGeCreated( created );
return query.list();
}
- private Query getQueryAllGeCreatedACL( Date created )
+ private Query getQueryAllGeCreatedAcl( Date created )
{
String hql = "select distinct c from " + clazz.getName() + " c"
+ " where c.created >= :created and ( c.publicAccess like 'r%' or c.user IS NULL or c.user=:user"
@@ -811,12 +811,12 @@
@SuppressWarnings("unchecked")
public List<T> getAllGeLastUpdatedOrderedName( Date lastUpdated )
{
- Query query = sharingEnabled() ? getQueryAllGeLastUpdatedOrderedNameACL( lastUpdated ) : getQueryAllGeLastUpdatedOrderedName( lastUpdated );
+ Query query = sharingEnabled() ? getQueryAllGeLastUpdatedOrderedNameAcl( lastUpdated ) : getQueryAllGeLastUpdatedOrderedName( lastUpdated );
return query.list();
}
- private Query getQueryAllGeLastUpdatedOrderedNameACL( Date lastUpdated )
+ private Query getQueryAllGeLastUpdatedOrderedNameAcl( Date lastUpdated )
{
String hql = "select distinct c from " + clazz.getName() + " c"
+ " where c.lastUpdated >= :lastUpdated and ( c.publicAccess like 'r%' or c.user IS NULL or c.user=:user"
@@ -899,7 +899,7 @@
protected boolean sharingEnabled()
{
return SharingUtils.isSupported( clazz ) && !( currentUserService.getCurrentUser() == null ||
- currentUserService.getCurrentUser().getUserCredentials().getAllAuthorities().contains( SharingUtils.SHARING_OVERRIDE_AUTHORITY ));
+ currentUserService.getCurrentUser().getUserCredentials().getAllAuthorities().contains( SharingUtils.SHARING_OVERRIDE_AUTHORITY ) );
}
protected boolean isReadAllowed( T object )