aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-core
diff options
context:
space:
mode:
authorFabrice Bellingard <fabrice.bellingard@sonarsource.com>2012-09-27 11:56:08 +0200
committerFabrice Bellingard <fabrice.bellingard@sonarsource.com>2012-09-27 11:56:08 +0200
commitb962250845d848e5c1f32eaee8deafc4792943a4 (patch)
treedf413b908fd0d31b7e99b06ff2c9ce1cc9a125c1 /sonar-core
parent2f6a92af31129c41881de8867aea968817624cc5 (diff)
downloadsonarqube-b962250845d848e5c1f32eaee8deafc4792943a4.tar.gz
sonarqube-b962250845d848e5c1f32eaee8deafc4792943a4.zip
SONAR-3636 Update MyBatis DTO method name
Diffstat (limited to 'sonar-core')
-rw-r--r--sonar-core/src/main/java/org/sonar/core/resource/ResourceDao.java2
-rw-r--r--sonar-core/src/main/java/org/sonar/core/resource/ResourceDto.java10
-rw-r--r--sonar-core/src/main/resources/org/sonar/core/resource/ResourceMapper.xml6
-rw-r--r--sonar-core/src/test/java/org/sonar/core/resource/ResourceDaoTest.java2
4 files changed, 10 insertions, 10 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/resource/ResourceDao.java b/sonar-core/src/main/java/org/sonar/core/resource/ResourceDao.java
index deaa26e9baf..7d50a1094b8 100644
--- a/sonar-core/src/main/java/org/sonar/core/resource/ResourceDao.java
+++ b/sonar-core/src/main/java/org/sonar/core/resource/ResourceDao.java
@@ -106,7 +106,7 @@ public class ResourceDao {
try {
for (ResourceDto resource : resources) {
if (resource.getId() == null) {
- resource.setDate(new Date());
+ resource.setCreatedAt(new Date());
mapper.insert(resource);
} else {
mapper.update(resource);
diff --git a/sonar-core/src/main/java/org/sonar/core/resource/ResourceDto.java b/sonar-core/src/main/java/org/sonar/core/resource/ResourceDto.java
index d8855935b84..73ee680a5d4 100644
--- a/sonar-core/src/main/java/org/sonar/core/resource/ResourceDto.java
+++ b/sonar-core/src/main/java/org/sonar/core/resource/ResourceDto.java
@@ -36,7 +36,7 @@ public final class ResourceDto {
private Long copyResourceId;
private Long personId;
private Long profileId;
- private Date date;
+ private Date createdAt;
public Long getId() {
return id;
@@ -155,12 +155,12 @@ public final class ResourceDto {
return this;
}
- public Date getDate() {
- return date;// NOSONAR May expose internal representation by returning reference to mutable object
+ public Date getCreatedAt() {
+ return createdAt;// NOSONAR May expose internal representation by returning reference to mutable object
}
- public ResourceDto setDate(Date date) {
- this.date = date;// NOSONAR May expose internal representation by incorporating reference to mutable object
+ public ResourceDto setCreatedAt(Date date) {
+ this.createdAt = date;// NOSONAR May expose internal representation by incorporating reference to mutable object
return this;
}
}
diff --git a/sonar-core/src/main/resources/org/sonar/core/resource/ResourceMapper.xml b/sonar-core/src/main/resources/org/sonar/core/resource/ResourceMapper.xml
index de2ba7b4c45..1d51aff6cc6 100644
--- a/sonar-core/src/main/resources/org/sonar/core/resource/ResourceMapper.xml
+++ b/sonar-core/src/main/resources/org/sonar/core/resource/ResourceMapper.xml
@@ -35,7 +35,7 @@
<result property="copyResourceId" column="copy_resource_id"/>
<result property="personId" column="person_id"/>
<result property="profileId" column="profile_id"/>
- <result property="date" column="created_at"/>
+ <result property="createdAt" column="created_at"/>
</resultMap>
<select id="selectResources" parameterType="map" resultMap="resourceResultMap">
@@ -90,7 +90,7 @@
values (
#{name}, #{longName}, #{description}, #{scope}, #{qualifier},
#{key}, #{language}, #{rootId}, #{copyResourceId},
- #{personId}, #{profileId}, #{enabled}, #{date}
+ #{personId}, #{profileId}, #{enabled}, #{createdAt}
)
</insert>
@@ -104,7 +104,7 @@
values (
#{id}, #{name}, #{longName}, #{description}, #{scope}, #{qualifier},
#{key}, #{language}, #{rootId}, #{copyResourceId},
- #{personId}, #{profileId}, #{enabled}, #{date}
+ #{personId}, #{profileId}, #{enabled}, #{createdAt}
)
</insert>
diff --git a/sonar-core/src/test/java/org/sonar/core/resource/ResourceDaoTest.java b/sonar-core/src/test/java/org/sonar/core/resource/ResourceDaoTest.java
index 86d75afbef5..261cdcd92ad 100644
--- a/sonar-core/src/test/java/org/sonar/core/resource/ResourceDaoTest.java
+++ b/sonar-core/src/test/java/org/sonar/core/resource/ResourceDaoTest.java
@@ -177,6 +177,6 @@ public class ResourceDaoTest extends AbstractDaoTestCase {
// SONAR-3636 : created_at must be fed when inserting a new entry in the 'projects' table
ResourceDto fileLoadedFromDB = dao.getResource(file1.getId());
- assertThat(fileLoadedFromDB.getDate()).isNotNull();
+ assertThat(fileLoadedFromDB.getCreatedAt()).isNotNull();
}
}