From 13a4c0670ee2caffd7a3fe04f82680e583b20607 Mon Sep 17 00:00:00 2001 From: Mice Xia Date: Thu, 7 Feb 2013 13:31:49 +0800 Subject: [PATCH] CLOUDSTACK-1176 1) remove 'final' modifier from id attribute in SnapshotVO 2) make state setter method comply with convention --- core/src/com/cloud/storage/SnapshotVO.java | 4 ++-- server/src/com/cloud/storage/dao/SnapshotDaoImpl.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/com/cloud/storage/SnapshotVO.java b/core/src/com/cloud/storage/SnapshotVO.java index 0aa489be7c4..68336cb97ec 100644 --- a/core/src/com/cloud/storage/SnapshotVO.java +++ b/core/src/com/cloud/storage/SnapshotVO.java @@ -31,7 +31,7 @@ public class SnapshotVO implements Snapshot { @Id @GeneratedValue(strategy=GenerationType.IDENTITY) @Column(name="id") - private final long id = -1; + private long id; @Column(name="data_center_id") long dataCenterId; @@ -248,7 +248,7 @@ public class SnapshotVO implements Snapshot { return state; } - public void setStatus(State state) { + public void setState(State state) { this.state = state; } diff --git a/server/src/com/cloud/storage/dao/SnapshotDaoImpl.java b/server/src/com/cloud/storage/dao/SnapshotDaoImpl.java index 17bcf9b1bcf..a8a07dcc3a6 100644 --- a/server/src/com/cloud/storage/dao/SnapshotDaoImpl.java +++ b/server/src/com/cloud/storage/dao/SnapshotDaoImpl.java @@ -328,7 +328,7 @@ public class SnapshotDaoImpl extends GenericDaoBase implements Transaction txn = Transaction.currentTxn(); txn.start(); SnapshotVO snapshotVO = (SnapshotVO)snapshot; - snapshotVO.setStatus(nextState); + snapshotVO.setState(nextState); super.update(snapshotVO.getId(), snapshotVO); txn.commit(); return true;