dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #20406
[Branch ~dhis2-devs-core/dhis2/trunk] Rev 9298: added new property to idObject 'created'
------------------------------------------------------------
revno: 9298
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2012-12-13 14:53:32 +0300
message:
added new property to idObject 'created'
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseIdentifiableObject.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/GenericIdentifiableObjectStore.java
dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/IdentifiableObject.java
dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/IdentityPopulator.java
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/common/identifiableProperties.hbm
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementCategoryOptionCombo.hbm.xml
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataset/hibernate/Section.hbm.xml
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/mapping/hibernate/Map.hbm.xml
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/mapping/hibernate/MapLegend.hbm.xml
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/mapping/hibernate/MapView.hbm.xml
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/message/hibernate/Message.hbm.xml
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/message/hibernate/MessageConversation.hbm.xml
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/user/hibernate/User.hbm.xml
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/user/hibernate/UserAuthorityGroup.hbm.xml
dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/user/hibernate/UserCredentials.hbm.xml
dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/chart/hibernate/Chart.hbm.xml
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-api/src/main/java/org/hisp/dhis/common/BaseIdentifiableObject.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseIdentifiableObject.java 2012-12-09 10:12:53 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseIdentifiableObject.java 2012-12-13 11:53:32 +0000
@@ -45,7 +45,7 @@
/**
* @author Bob Jolliffe
*/
-@JacksonXmlRootElement( localName = "identifiableObject", namespace = Dxf2Namespace.NAMESPACE )
+@JacksonXmlRootElement(localName = "identifiableObject", namespace = Dxf2Namespace.NAMESPACE)
public class BaseIdentifiableObject
extends BaseLinkableObject
implements IdentifiableObject
@@ -76,6 +76,11 @@
protected String name;
/**
+ * The date this object was created.
+ */
+ protected Date created;
+
+ /**
* The date this object was last updated.
*/
protected Date lastUpdated;
@@ -105,6 +110,7 @@
this.id = identifiableObject.getId();
this.uid = identifiableObject.getUid();
this.name = identifiableObject.getName();
+ this.created = identifiableObject.getCreated();
this.lastUpdated = identifiableObject.getLastUpdated();
}
@@ -133,8 +139,8 @@
this.id = id;
}
- @JsonProperty( value = "id" )
- @JacksonXmlProperty( localName = "id", isAttribute = true )
+ @JsonProperty(value = "id")
+ @JacksonXmlProperty(localName = "id", isAttribute = true)
public String getUid()
{
return uid;
@@ -146,8 +152,8 @@
}
@JsonProperty
- @JsonView( { DetailedView.class, BasicView.class, ExportView.class } )
- @JacksonXmlProperty( isAttribute = true )
+ @JsonView({ DetailedView.class, BasicView.class, ExportView.class })
+ @JacksonXmlProperty(isAttribute = true)
public String getCode()
{
return code;
@@ -159,8 +165,8 @@
}
@JsonProperty
- @JsonView( { DetailedView.class, BasicView.class, ExportView.class } )
- @JacksonXmlProperty( isAttribute = true )
+ @JsonView({ DetailedView.class, BasicView.class, ExportView.class })
+ @JacksonXmlProperty(isAttribute = true)
public String getName()
{
return name;
@@ -174,6 +180,19 @@
@JsonProperty
@JsonView( { DetailedView.class, BasicView.class, ExportView.class } )
@JacksonXmlProperty( isAttribute = true )
+ public Date getCreated()
+ {
+ return created;
+ }
+
+ public void setCreated( Date created )
+ {
+ this.created = created;
+ }
+
+ @JsonProperty
+ @JsonView({ DetailedView.class, BasicView.class, ExportView.class })
+ @JacksonXmlProperty(isAttribute = true)
public Date getLastUpdated()
{
return lastUpdated;
@@ -253,7 +272,9 @@
setUid( CodeGenerator.generateCode() );
}
- setLastUpdated( new Date() );
+ Date date = new Date();
+
+ setLastUpdated( date );
}
/**
@@ -318,8 +339,14 @@
@Override
public String toString()
{
- return "{" + "id=" + getId() + ", uid='" + getUid() + '\'' + ", code='" +
- getCode() + '\'' + ", name='" + getName() + '\'' + ", lastUpdated=" + getLastUpdated() + "}";
+ return "IdentifiableObject{" +
+ "id=" + id +
+ ", uid='" + uid + '\'' +
+ ", code='" + code + '\'' +
+ ", name='" + name + '\'' +
+ ", created=" + created +
+ ", lastUpdated=" + lastUpdated +
+ '}';
}
@Override
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/GenericIdentifiableObjectStore.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/GenericIdentifiableObjectStore.java 2012-10-26 15:53:06 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/GenericIdentifiableObjectStore.java 2012-12-13 11:53:32 +0000
@@ -112,6 +112,14 @@
/**
* Returns all objects that are equal to or newer than given date.
*
+ * @param created Date to compare with.
+ * @return All objects equal or newer than given date.
+ */
+ List<T> getByCreated( Date created );
+
+ /**
+ * Returns all objects that are equal to or newer than given date.
+ *
* @param lastUpdated Date to compare with.
* @return All objects equal or newer than given date.
*/
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/IdentifiableObject.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/IdentifiableObject.java 2012-04-06 21:31:51 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/IdentifiableObject.java 2012-12-13 11:53:32 +0000
@@ -33,12 +33,12 @@
extends ImportableObject, LinkableObject, Comparable<IdentifiableObject>, Mergeable<IdentifiableObject>
{
final String[] I18N_PROPERTIES = { "name" };
-
+
enum IdentifiableProperty
{
ID, UID, NAME, CODE
}
-
+
int getId();
String getUid();
@@ -47,6 +47,8 @@
String getCode();
+ Date getCreated();
+
Date getLastUpdated();
String getDisplayName();
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/IdentityPopulator.java'
--- dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/IdentityPopulator.java 2012-11-05 06:27:18 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/java/org/hisp/dhis/common/IdentityPopulator.java 2012-12-13 11:53:32 +0000
@@ -34,7 +34,11 @@
import org.hisp.dhis.system.startup.AbstractStartupRoutine;
import org.springframework.transaction.annotation.Transactional;
-import java.sql.*;
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.sql.Timestamp;
import java.util.Date;
/**
@@ -45,7 +49,7 @@
{
private static final Log log = LogFactory.getLog( IdentityPopulator.class );
- private static String[] tables = {"chart", "constant", "attribute", "indicatortype", "indicatorgroupset", "indicator",
+ private static String[] tables = { "chart", "constant", "attribute", "indicatortype", "indicatorgroupset", "indicator",
"indicatorgroup", "datadictionary", "validationrulegroup", "validationrule", "dataset", "orgunitlevel", "document",
"organisationunit", "orgunitgroup", "orgunitgroupset", "dataelementcategoryoption", "dataelementgroup", "sqlview",
"dataelement", "dataelementgroupset", "dataelementcategory", "categorycombo", "categoryoptioncombo", "map", "mapview",
@@ -107,23 +111,36 @@
Timestamp now = new Timestamp( new Date().getTime() );
resultSet = statement.executeQuery( "SELECT * from " + table + " WHERE lastUpdated IS NULL" );
+
while ( resultSet.next() )
{
++count;
resultSet.updateTimestamp( "lastUpdated", now );
resultSet.updateRow();
}
+
+ resultSet = statement.executeQuery( "SELECT * from " + table + " WHERE created IS NULL" );
+
+ while ( resultSet.next() )
+ {
+ ++count;
+ resultSet.updateTimestamp( "created", resultSet.getTimestamp( "lastUpdated" ) );
+ resultSet.updateRow();
+ }
+
if ( count > 0 )
{
log.info( count + " timestamps updated on " + table );
}
- } catch ( SQLException ex )
+ }
+ catch ( SQLException ex )
{
log.info( "Problem updating " + table + ": ", ex );
}
}
- } finally
+ }
+ finally
{
if ( statement != null )
{
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/common/identifiableProperties.hbm'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/common/identifiableProperties.hbm 2011-11-22 15:48:30 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/common/identifiableProperties.hbm 2012-12-13 11:53:32 +0000
@@ -1,4 +1,5 @@
<property name="name" column="name" not-null="true" unique="true" length="230" />
<property name="uid" column="uid" length="11" />
<property name="code" column="code" not-null="false" unique="true" length="50" />
+ <property name="created" type="timestamp"/>
<property name="lastUpdated" type="timestamp"/>
\ No newline at end of file
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementCategoryOptionCombo.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementCategoryOptionCombo.hbm.xml 2012-10-02 18:18:48 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataelement/hibernate/DataElementCategoryOptionCombo.hbm.xml 2012-12-13 11:53:32 +0000
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
- "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
- "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="org.hisp.dhis.dataelement.DataElementCategoryOptionCombo" table="categoryoptioncombo">
@@ -16,13 +16,15 @@
<property name="code" column="code" not-null="false" unique="true" length="50" />
+ <property name="created" type="timestamp" />
+
<property name="lastUpdated" type="timestamp" />
<set name="categoryOptions" table="categoryoptioncombos_categoryoptions">
<cache usage="read-write" />
<key column="categoryoptioncomboid" foreign-key="fk_categoryoptioncombos_categoryoptions_categoryoptioncomboid" />
<many-to-many class="org.hisp.dhis.dataelement.DataElementCategoryOption" column="categoryoptionid"
- foreign-key="fk_categoryoptioncombo_categoryoptionid" />
+ foreign-key="fk_categoryoptioncombo_categoryoptionid" />
</set>
<join table="categorycombos_optioncombos">
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataset/hibernate/Section.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataset/hibernate/Section.hbm.xml 2012-04-13 10:38:21 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataset/hibernate/Section.hbm.xml 2012-12-13 11:53:32 +0000
@@ -22,6 +22,8 @@
<property name="code" column="code" not-null="false" unique="true" length="50" />
+ <property name="created" type="timestamp" />
+
<property name="lastUpdated" type="timestamp" />
<many-to-one name="dataSet" class="org.hisp.dhis.dataset.DataSet" column="datasetid"
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/mapping/hibernate/Map.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/mapping/hibernate/Map.hbm.xml 2012-11-01 13:40:28 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/mapping/hibernate/Map.hbm.xml 2012-12-13 11:53:32 +0000
@@ -3,7 +3,7 @@
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"
[<!ENTITY identifiableProperties SYSTEM "classpath://org/hisp/dhis/common/identifiableProperties.hbm">]
->
+ >
<hibernate-mapping>
<class name="org.hisp.dhis.mapping.Map" table="map">
@@ -13,29 +13,31 @@
<id name="id" column="mapid">
<generator class="native" />
</id>
-
+
<property name="name" column="name" not-null="true" length="230" />
-
+
<property name="uid" column="uid" length="11" />
-
+
+ <property name="created" type="timestamp" />
+
<property name="lastUpdated" type="timestamp" />
-
- <many-to-one name="user" class="org.hisp.dhis.user.User"
- column="userid" foreign-key="fk_mapview_userid" />
-
+
+ <many-to-one name="user" class="org.hisp.dhis.user.User"
+ column="userid" foreign-key="fk_mapview_userid" />
+
<property name="longitude" />
-
+
<property name="latitude" />
-
+
<property name="zoom" />
-
+
<list name="mapViews" table="mapmapviews">
<cache usage="read-write" />
<key column="mapid" foreign-key="fk_mapmapview_mapid" />
<list-index column="sort_order" base="0" />
- <many-to-many column="mapviewid" class="org.hisp.dhis.mapping.MapView"
+ <many-to-many column="mapviewid" class="org.hisp.dhis.mapping.MapView"
foreign-key="fk_mapmapview_mapviewid" />
</list>
-
+
</class>
</hibernate-mapping>
\ No newline at end of file
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/mapping/hibernate/MapLegend.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/mapping/hibernate/MapLegend.hbm.xml 2012-10-26 17:22:12 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/mapping/hibernate/MapLegend.hbm.xml 2012-12-13 11:53:32 +0000
@@ -3,19 +3,24 @@
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"
[<!ENTITY identifiableProperties SYSTEM "classpath://org/hisp/dhis/common/identifiableProperties.hbm">]
->
+ >
<hibernate-mapping>
<class name="org.hisp.dhis.mapping.MapLegend" table="maplegend">
<id name="id" column="maplegendid">
<generator class="native" />
- </id>
-
+ </id>
+
<property name="name" column="name" not-null="true" length="230" />
+
<property name="uid" column="uid" length="11" />
+
<property name="code" column="code" not-null="false" unique="true" length="50" />
- <property name="lastUpdated" type="timestamp"/>
+
+ <property name="created" type="timestamp" />
+
+ <property name="lastUpdated" type="timestamp" />
<property name="startValue" column="startvalue" />
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/mapping/hibernate/MapView.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/mapping/hibernate/MapView.hbm.xml 2012-11-08 13:21:04 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/mapping/hibernate/MapView.hbm.xml 2012-12-13 11:53:32 +0000
@@ -3,7 +3,7 @@
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"
[<!ENTITY identifiableProperties SYSTEM "classpath://org/hisp/dhis/common/identifiableProperties.hbm">]
->
+ >
<hibernate-mapping>
<class name="org.hisp.dhis.mapping.MapView" table="mapview">
@@ -11,10 +11,12 @@
<id name="id" column="mapviewid">
<generator class="native" />
</id>
-
+
<property name="uid" column="uid" length="11" />
-
- <property name="lastUpdated" type="timestamp"/>
+
+ <property name="created" type="timestamp" />
+
+ <property name="lastUpdated" type="timestamp" />
<property name="layer" />
@@ -56,12 +58,12 @@
<property name="radiusLow" />
<property name="radiusHigh" />
-
+
<property name="opacity" />
- <many-to-one name="organisationUnitGroupSet" class="org.hisp.dhis.organisationunit.OrganisationUnitGroupSet"
- column="orgunitgroupsetid" foreign-key="fk_mapview_orgunitgroupsetid" />
-
+ <many-to-one name="organisationUnitGroupSet" class="org.hisp.dhis.organisationunit.OrganisationUnitGroupSet"
+ column="orgunitgroupsetid" foreign-key="fk_mapview_orgunitgroupsetid" />
+
<property name="areaRadius" />
</class>
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/message/hibernate/Message.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/message/hibernate/Message.hbm.xml 2011-12-14 09:17:14 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/message/hibernate/Message.hbm.xml 2012-12-13 11:53:32 +0000
@@ -11,15 +11,19 @@
<id name="id" column="messageid">
<generator class="native" />
</id>
-
+
<property name="uid" column="uid" length="11" />
- <property name="lastUpdated" type="timestamp"/>
-
- <property name="text" column="messagetext"/>
- <property name="metaData" column="metadata"/>
-
- <many-to-one name="sender" class="org.hisp.dhis.user.User" column="userid"
- foreign-key="fk_message_userid" />
-
+
+ <property name="created" type="timestamp" />
+
+ <property name="lastUpdated" type="timestamp" />
+
+ <property name="text" column="messagetext" />
+
+ <property name="metaData" column="metadata" />
+
+ <many-to-one name="sender" class="org.hisp.dhis.user.User" column="userid"
+ foreign-key="fk_message_userid" />
+
</class>
</hibernate-mapping>
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/message/hibernate/MessageConversation.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/message/hibernate/MessageConversation.hbm.xml 2012-02-15 17:26:35 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/message/hibernate/MessageConversation.hbm.xml 2012-12-13 11:53:32 +0000
@@ -11,29 +11,32 @@
<id name="id" column="messageconversationid">
<generator class="native" />
</id>
-
+
<property name="uid" column="uid" length="11" />
- <property name="lastUpdated" type="timestamp"/>
+
+ <property name="created" type="timestamp" />
+
+ <property name="lastUpdated" type="timestamp" />
<property name="subject" column="subject" not-null="true" />
<set name="userMessages" table="messageconversation_usermessages" cascade="all,delete-orphan">
<key column="messageconversationid" foreign-key="fk_messageconversation_usermessages_messageconversationid" />
- <many-to-many class="org.hisp.dhis.message.UserMessage" column="usermessageid"
- unique="true" foreign-key="fk_messageconversation_usermessages_usermessageid" />
+ <many-to-many class="org.hisp.dhis.message.UserMessage" column="usermessageid"
+ unique="true" foreign-key="fk_messageconversation_usermessages_usermessageid" />
</set>
-
- <list name="messages" table="messageconversation_messages" cascade="all,delete-orphan">
- <key column="messageconversationid" foreign-key="fk_messageconversation_messages_messageconversationid" />
- <list-index column="sort_order" base="1" />
- <many-to-many class="org.hisp.dhis.message.Message" column="messageid"
- unique="true" foreign-key="fk_messageconversation_messages_messageid" />
- </list>
-
- <many-to-one name="lastSender" class="org.hisp.dhis.user.User" column="lastsenderid"
- foreign-key="fk_messageconversation_userid" />
-
- <property name="lastMessage" column="lastmessage"/>
-
+
+ <list name="messages" table="messageconversation_messages" cascade="all,delete-orphan">
+ <key column="messageconversationid" foreign-key="fk_messageconversation_messages_messageconversationid" />
+ <list-index column="sort_order" base="1" />
+ <many-to-many class="org.hisp.dhis.message.Message" column="messageid"
+ unique="true" foreign-key="fk_messageconversation_messages_messageid" />
+ </list>
+
+ <many-to-one name="lastSender" class="org.hisp.dhis.user.User" column="lastsenderid"
+ foreign-key="fk_messageconversation_userid" />
+
+ <property name="lastMessage" column="lastmessage" />
+
</class>
</hibernate-mapping>
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/user/hibernate/User.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/user/hibernate/User.hbm.xml 2012-10-07 20:10:20 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/user/hibernate/User.hbm.xml 2012-12-13 11:53:32 +0000
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
- "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
- "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="org.hisp.dhis.user.User" lazy="false" table="userinfo">
@@ -18,6 +18,8 @@
<property name="lastUpdated" type="timestamp" />
+ <property name="created" type="timestamp" />
+
<property name="surname" not-null="true" length="160" />
<property name="firstName" not-null="true" length="160" />
@@ -25,26 +27,26 @@
<property name="email" length="160" />
<property name="phoneNumber" length="80" />
-
- <property name="jobTitle" length="160" />
-
- <property name="introduction" type="text" />
-
- <property name="gender" length="50" />
-
- <property name="birthday" type="date" />
-
- <property name="nationality" length="160" />
-
- <property name="employer" length="160" />
-
- <property name="education" type="text" />
-
- <property name="interests" type="text" />
-
- <property name="languages" type="text" />
-
- <property name="lastCheckedInterpretations" type="timestamp" />
+
+ <property name="jobTitle" length="160" />
+
+ <property name="introduction" type="text" />
+
+ <property name="gender" length="50" />
+
+ <property name="birthday" type="date" />
+
+ <property name="nationality" length="160" />
+
+ <property name="employer" length="160" />
+
+ <property name="education" type="text" />
+
+ <property name="interests" type="text" />
+
+ <property name="languages" type="text" />
+
+ <property name="lastCheckedInterpretations" type="timestamp" />
<one-to-one name="userCredentials" class="org.hisp.dhis.user.UserCredentials" foreign-key="fk_userinfo_userid" />
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/user/hibernate/UserAuthorityGroup.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/user/hibernate/UserAuthorityGroup.hbm.xml 2012-09-03 19:53:34 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/user/hibernate/UserAuthorityGroup.hbm.xml 2012-12-13 11:53:32 +0000
@@ -3,7 +3,7 @@
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"
[<!ENTITY identifiableProperties SYSTEM "classpath://org/hisp/dhis/common/identifiableProperties.hbm">]
->
+ >
<hibernate-mapping>
<class name="org.hisp.dhis.user.UserAuthorityGroup" table="userrole">
@@ -17,7 +17,7 @@
<set name="members" table="userrolemembers" inverse="true">
<key column="userroleid" />
- <many-to-many column="userid" class="org.hisp.dhis.user.UserCredentials"/>
+ <many-to-many column="userid" class="org.hisp.dhis.user.UserCredentials" />
</set>
<set name="authorities" table="userroleauthorities">
=== modified file 'dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/user/hibernate/UserCredentials.hbm.xml'
--- dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/user/hibernate/UserCredentials.hbm.xml 2012-11-08 09:46:51 +0000
+++ dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/user/hibernate/UserCredentials.hbm.xml 2012-12-13 11:53:32 +0000
@@ -29,19 +29,19 @@
<key column="userid" foreign-key="fk_userrolemembers_userid" />
<many-to-many column="userroleid" class="org.hisp.dhis.user.UserAuthorityGroup" foreign-key="fk_userrolemembers_userroleid" />
</set>
-
- <property name="lastLogin" />
+
+ <property name="lastLogin" />
<property name="restoreToken" />
-
+
<property name="restoreCode" />
-
+
<property name="restoreExpiry" type="timestamp" />
-
+
<property name="selfRegistered" />
-
+
<property name="disabled" />
-
+
<property name="created" />
</class>
=== modified file 'dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/chart/hibernate/Chart.hbm.xml'
--- dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/chart/hibernate/Chart.hbm.xml 2012-07-24 04:04:14 +0000
+++ dhis-2/dhis-services/dhis-service-reporting/src/main/resources/org/hisp/dhis/chart/hibernate/Chart.hbm.xml 2012-12-13 11:53:32 +0000
@@ -1,9 +1,9 @@
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
- "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
- "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"
- [<!ENTITY identifiableProperties SYSTEM "classpath://org/hisp/dhis/common/identifiableProperties.hbm">]
- >
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"
+ [<!ENTITY identifiableProperties SYSTEM "classpath://org/hisp/dhis/common/identifiableProperties.hbm">]
+ >
<hibernate-mapping>
<class name="org.hisp.dhis.chart.Chart" table="chart">
@@ -15,9 +15,11 @@
</id>
<property name="name" column="name" not-null="true" length="230" />
-
+
<property name="uid" column="uid" length="11" />
-
+
+ <property name="created" type="timestamp" />
+
<property name="lastUpdated" type="timestamp" />
<property name="domainAxisLabel" />
@@ -51,7 +53,7 @@
<key column="chartid" foreign-key="fk_chart_indicators_chartid" />
<list-index column="sort_order" base="0" />
<many-to-many column="indicatorid" class="org.hisp.dhis.indicator.Indicator"
- foreign-key="fk_chart_indicators_indicatorid" />
+ foreign-key="fk_chart_indicators_indicatorid" />
</list>
<list name="dataElements" table="chart_dataelements">
@@ -59,7 +61,7 @@
<key column="chartid" foreign-key="fk_chart_dataelements_chartid" />
<list-index column="sort_order" base="0" />
<many-to-many column="dataelementid" class="org.hisp.dhis.dataelement.DataElement"
- foreign-key="fk_chart_dataelements_dataelementid" />
+ foreign-key="fk_chart_dataelements_dataelementid" />
</list>
<list name="dataSets" table="chart_datasets">
@@ -67,7 +69,7 @@
<key column="chartid" foreign-key="fk_chart_datasets_chartid" />
<list-index column="sort_order" base="0" />
<many-to-many column="datasetid" class="org.hisp.dhis.dataset.DataSet"
- foreign-key="fk_chart_datasets_datasetid" />
+ foreign-key="fk_chart_datasets_datasetid" />
</list>
<list name="organisationUnits" table="chart_organisationunits">
@@ -75,18 +77,18 @@
<key column="chartid" foreign-key="fk_chart_organisationunits_chartid" />
<list-index column="sort_order" base="0" />
<many-to-many column="organisationunitid" class="org.hisp.dhis.organisationunit.OrganisationUnit"
- foreign-key="fk_chart_organisationunits_organisationunitid" />
+ foreign-key="fk_chart_organisationunits_organisationunitid" />
</list>
<many-to-one name="organisationUnitGroupSet" class="org.hisp.dhis.organisationunit.OrganisationUnitGroupSet"
- column="organisationunitgroupsetid" foreign-key="fk_chart_organisationunitgroupsetid" />
+ column="organisationunitgroupsetid" foreign-key="fk_chart_organisationunitgroupsetid" />
<list name="periods" table="chart_periods">
<cache usage="read-write" />
<key column="chartid" foreign-key="fk_chart_periods_chartid" />
<list-index column="sort_order" base="0" />
<many-to-many column="periodid" class="org.hisp.dhis.period.Period"
- foreign-key="fk_chart_periods_periodid" />
+ foreign-key="fk_chart_periods_periodid" />
</list>
<component name="relatives">
@@ -107,8 +109,8 @@
<property name="userOrganisationUnitChildren" />
<property name="showData" />
-
- <property name="rewindRelativePeriods" />
+
+ <property name="rewindRelativePeriods" />
<many-to-one name="user" class="org.hisp.dhis.user.User" column="userid" foreign-key="fk_chart_userid" />
=== 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 2012-11-25 18:27:00 +0000
+++ dhis-2/dhis-support/dhis-support-hibernate/src/main/java/org/hisp/dhis/hibernate/HibernateGenericStore.java 2012-12-13 11:53:32 +0000
@@ -390,6 +390,13 @@
@Override
@SuppressWarnings( "unchecked" )
+ public List<T> getByCreated( Date created )
+ {
+ return getCriteria().add( Restrictions.ge( "created", created ) ).list();
+ }
+
+ @Override
+ @SuppressWarnings( "unchecked" )
public List<T> getByLastUpdatedSorted( Date lastUpdated )
{
return getCriteria().add( Restrictions.ge( "lastUpdated", lastUpdated ) ).addOrder( Order.asc( "name" ) ).list();