← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19767: minor fix, don't use column.length as max for Number types by default

 

------------------------------------------------------------
revno: 19767
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Wed 2015-08-12 09:48:13 +0700
message:
  minor fix, don't use column.length as max for Number types by default
modified:
  dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/schema/AbstractPropertyIntrospectorService.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-services/dhis-service-core/src/main/java/org/hisp/dhis/schema/AbstractPropertyIntrospectorService.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/schema/AbstractPropertyIntrospectorService.java	2015-05-29 18:36:33 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/schema/AbstractPropertyIntrospectorService.java	2015-08-12 02:48:13 +0000
@@ -40,6 +40,9 @@
 import org.hibernate.persister.entity.Joinable;
 import org.hibernate.type.AssociationType;
 import org.hibernate.type.CollectionType;
+import org.hibernate.type.DoubleType;
+import org.hibernate.type.IntegerType;
+import org.hibernate.type.LongType;
 import org.hibernate.type.ManyToOneType;
 import org.hibernate.type.OneToOneType;
 import org.hibernate.type.SetType;
@@ -281,7 +284,8 @@
                 property.setMax( column.getLength() );
                 property.setLength( column.getLength() );
 
-                if ( TextType.class.isInstance( type ) )
+                if ( TextType.class.isInstance( type ) || LongType.class.isInstance( type )
+                    || IntegerType.class.isInstance( type ) || DoubleType.class.isInstance( type ) )
                 {
                     property.setMin( 0 );
                     property.setMax( Integer.MAX_VALUE );