modules/core/dbutils/pom.xml | 2 - modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml | 1 modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml | 10 +++++++++ modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java | 11 ++++++++++ 4 files changed, 23 insertions(+), 1 deletion(-)
New commits: commit e60ff628d63a550a7ef0362cd4859c7b6d78b4c4 Author: John Sanda jsanda@redhat.com Date: Tue Oct 19 13:04:46 2010 -0400
Adding deleted flag to ResourceType
This commit also included the dbsetup/dbupgrade changes. The deleted flag will be set to indicate that a ResourceType will be deleted.
diff --git a/modules/core/dbutils/pom.xml b/modules/core/dbutils/pom.xml index 379c31f..8f393cc 100644 --- a/modules/core/dbutils/pom.xml +++ b/modules/core/dbutils/pom.xml @@ -22,7 +22,7 @@
<properties> <scm.module.path>modules/core/dbutils/</scm.module.path> - <db.schema.version>2.100</db.schema.version> + <db.schema.version>2.101</db.schema.version> </properties>
<dependencies> diff --git a/modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml b/modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml index 48f9f2a..1644849 100644 --- a/modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml +++ b/modules/core/dbutils/src/main/scripts/dbsetup/inventory-schema.xml @@ -17,6 +17,7 @@ <column name="PLUGIN" type="VARCHAR2" size="100"/> <column name="CTIME" type="LONG"/> <column name="MTIME" type="LONG"/> + <column name="DELETED" type="BOOLEAN" default="FALSE"/> <column name="SUBCATEGORY_ID" type="INTEGER"/> <!-- TODO add support to DB setup for tables with circular dependencies and then add back this RI diff --git a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml index b462cfa..4b4c6a0 100644 --- a/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml +++ b/modules/core/dbutils/src/main/scripts/dbupgrade/db-upgrade.xml @@ -3254,6 +3254,16 @@ <!-- location was only exposed in the struts-based UI, so it hasn't been seen in years anyway --> <schema-deleteColumn table="RHQ_RESOURCE_GROUP" column="LOCATION" /> </schemaSpec> + + <schemaSpec version="2.101"> + <schema-addColumn table="RHQ_RESOURCE_TYPE" column="DELETED" columnType="BOOLEAN"/> + <schema-directSQL> + <statement desc="Set deleted flag for existing resources types to false"> + UPDATE RHQ_RESOURCE_TYPE + SET DELETED = false + </statement> + </schema-directSQL> + </schemaSpec> </dbupgrade> </target> </project> diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java index 19cdd11..add1a53 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java @@ -307,6 +307,9 @@ public class ResourceType implements Serializable, Comparable<ResourceType> { @Column(name = "MTIME") private Long mtime;
+ @Column(name = "DELETED") + private boolean deleted; + @ManyToMany(mappedBy = "parentResourceTypes", cascade = { CascadeType.REFRESH }) @OrderBy //@Cache(usage = CacheConcurrencyStrategy.TRANSACTIONAL) @@ -534,6 +537,14 @@ public class ResourceType implements Serializable, Comparable<ResourceType> { return this.mtime; }
+ public boolean isDeleted() { + return deleted; + } + + public void setDeleted(boolean deleted) { + this.deleted = deleted; + } + @PreUpdate void onUpdate() { this.mtime = System.currentTimeMillis();
rhq-commits@lists.fedorahosted.org