modules/core/domain/src/main/java/org/rhq/core/domain/bundle/Bundle.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDeployment.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDestination.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleFile.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleResourceDeployment.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleResourceDeploymentHistory.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleType.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleVersion.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/cloud/AffinityGroup.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/cloud/FailoverList.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/cloud/FailoverListDetails.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/cloud/PartitionEvent.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/cloud/PartitionEventDetails.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/cloud/Server.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/common/SystemConfiguration.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/configuration/AbstractResourceConfigurationUpdate.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/configuration/Configuration.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/configuration/Property.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/configuration/RawConfiguration.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/ConfigurationDefinition.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/ConfigurationTemplate.java | 6 ++---- modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/PropertyDefinition.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/PropertyDefinitionEnumeration.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/PropertyGroupDefinition.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/PropertyOptionsSource.java | 6 ++---- modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/constraint/Constraint.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/configuration/group/AbstractGroupConfigurationUpdate.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/content/Advisory.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/content/AdvisoryBuglist.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/content/AdvisoryCVE.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/content/AdvisoryPackage.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/content/Architecture.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/content/CVE.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/content/ContentServiceRequest.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/content/ContentSource.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/content/ContentSourceSyncResults.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/content/ContentSourceType.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/content/Distribution.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/content/DistributionFile.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/content/DistributionType.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/content/InstalledPackage.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/content/InstalledPackageHistory.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/content/Package.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageBitsBlob.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageInstallationStep.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageType.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageVersion.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/content/Repo.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoGroup.java | 10 +++++----- modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoGroupType.java | 8 ++++---- modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoRelationship.java | 8 ++++---- modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoRelationshipType.java | 8 ++++---- modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoSyncResults.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftDefinition.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftDefinitionTemplate.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/drift/JPADrift.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/drift/JPADriftChangeSet.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/drift/JPADriftSet.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/event/Event.java | 5 +++-- modules/core/domain/src/main/java/org/rhq/core/domain/event/EventDefinition.java | 5 +++-- modules/core/domain/src/main/java/org/rhq/core/domain/event/EventSource.java | 5 +++-- modules/core/domain/src/main/java/org/rhq/core/domain/measurement/Availability.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/measurement/MeasurementBaseline.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/measurement/MeasurementDefinition.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/measurement/MeasurementSchedule.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/measurement/ResourceAvailability.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/measurement/calltime/CallTimeDataKey.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/measurement/calltime/CallTimeDataValue.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/operation/OperationDefinition.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/operation/OperationHistory.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/operation/OperationScheduleEntity.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/plugin/AbstractPlugin.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/resource/Agent.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/resource/CreateResourceHistory.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/resource/DeleteResourceHistory.java | 6 ++---- modules/core/domain/src/main/java/org/rhq/core/domain/resource/ProcessScan.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/resource/ProductVersion.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceError.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceSubCategory.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceType.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/GroupDefinition.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/LdapGroup.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/ResourceGroup.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/search/SavedSearch.java | 4 ++-- modules/core/domain/src/main/java/org/rhq/core/domain/tagging/Tag.java | 4 ++-- 86 files changed, 184 insertions(+), 187 deletions(-)
New commits: commit 9ff285a78afeb6843eaafbc4c6cdc078d47df5d4 Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed Mar 13 17:14:03 2013 -0400
We did not have a consistent approach to naming SequenceGenerators. To avoid confusion, and because there is some evidence that duplicating names in the same persistence context may be a bad idea, settle on using the name of the underlying sequence as the generator name.
This should be safe for upgrades since (currently) hibernate seems to be using the the desired sequence (specified by sequenceName) despite duplicate generator names in the same context. We want to ensure that a change in Hibernate impl won't affect us adversely.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/Bundle.java b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/Bundle.java index de09d25..7b5499f 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/Bundle.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/Bundle.java @@ -65,7 +65,7 @@ import org.rhq.core.domain.tagging.Tag; + "(:type = b.bundleType.name OR :type IS NULL) AND (:name = b.name OR :name IS NULL)")
}) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_BUNDLE_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_BUNDLE_ID_SEQ", sequenceName = "RHQ_BUNDLE_ID_SEQ") @Table(name = "RHQ_BUNDLE") @XmlAccessorType(XmlAccessType.FIELD) public class Bundle implements Serializable { @@ -76,7 +76,7 @@ public class Bundle implements Serializable { public static final String QUERY_FIND_BY_TYPE_AND_NAME = "Bundle.findByTypeAndName";
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_BUNDLE_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDeployment.java b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDeployment.java index a9680f3..1507f9a 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDeployment.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDeployment.java @@ -78,7 +78,7 @@ import org.rhq.core.domain.tagging.Tag; + " WHERE bd.replacedBundleDeploymentId IN " // + " ( SELECT innerbd.id FROM BundleDeployment innerbd " // + " WHERE innerbd.bundleVersion.id = :bundleVersionId ) ") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_BUNDLE_DEPLOYMENT_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_BUNDLE_DEPLOYMENT_ID_SEQ", sequenceName = "RHQ_BUNDLE_DEPLOYMENT_ID_SEQ") @Table(name = "RHQ_BUNDLE_DEPLOYMENT") @XmlAccessorType(XmlAccessType.FIELD) public class BundleDeployment implements Serializable { @@ -89,7 +89,7 @@ public class BundleDeployment implements Serializable { public static final String QUERY_UPDATE_FOR_VERSION_REMOVE = "BundleDeployment.updateForVersionRemove";
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_BUNDLE_DEPLOYMENT_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDestination.java b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDestination.java index a326b46..0d9e3ff 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDestination.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleDestination.java @@ -60,7 +60,7 @@ import org.rhq.core.domain.tagging.Tag; @Entity @NamedQueries( { @NamedQuery(name = BundleDestination.QUERY_FIND_ALL, query = "SELECT bd FROM BundleDestination bd") // }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_BUNDLE_DESTINATION_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_BUNDLE_DESTINATION_ID_SEQ", sequenceName = "RHQ_BUNDLE_DESTINATION_ID_SEQ") @Table(name = "RHQ_BUNDLE_DESTINATION") @XmlAccessorType(XmlAccessType.FIELD) public class BundleDestination implements Serializable { @@ -69,7 +69,7 @@ public class BundleDestination implements Serializable { public static final String QUERY_FIND_ALL = "BundleDestination.findAll";
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_BUNDLE_DESTINATION_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleFile.java b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleFile.java index 60ebc13..00611e2 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleFile.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleFile.java @@ -52,7 +52,7 @@ import org.rhq.core.domain.content.PackageVersion; @NamedQuery(name = BundleFile.QUERY_FIND_ALL, query = "SELECT bf FROM BundleFile bf"), // @NamedQuery(name = BundleFile.QUERY_FIND_BY_BUNDLE_VERSION_ID, query = "SELECT bf FROM BundleFile bf WHERE bf.bundleVersion.id = :id") // }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_BUNDLE_FILE_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_BUNDLE_FILE_ID_SEQ", sequenceName = "RHQ_BUNDLE_FILE_ID_SEQ") @Table(name = "RHQ_BUNDLE_FILE") @XmlAccessorType(XmlAccessType.FIELD) public class BundleFile implements Serializable { @@ -62,7 +62,7 @@ public class BundleFile implements Serializable { public static final String QUERY_FIND_BY_BUNDLE_VERSION_ID = "BundleFile.findByBundleVersionId";
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_BUNDLE_FILE_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleResourceDeployment.java b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleResourceDeployment.java index aa21aa1..a1c705f 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleResourceDeployment.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleResourceDeployment.java @@ -62,7 +62,7 @@ import org.rhq.core.domain.resource.Resource; + " WHERE brd.resource.id IN ( :resourceIds ) )"), @NamedQuery(name = BundleResourceDeployment.QUERY_FIND_BY_DEPLOYMENT_ID_NO_FETCH, query = "SELECT brd FROM BundleResourceDeployment brd WHERE brd.bundleDeployment.id = :id "), @NamedQuery(name = BundleResourceDeployment.QUERY_FIND_BY_RESOURCE_ID_NO_FETCH, query = "SELECT brd FROM BundleResourceDeployment brd WHERE brd.resource.id = :id ") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_BUNDLE_RES_DEPLOY_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_BUNDLE_RES_DEPLOY_ID_SEQ", sequenceName = "RHQ_BUNDLE_RES_DEPLOY_ID_SEQ") @Table(name = "RHQ_BUNDLE_RES_DEPLOY") @XmlAccessorType(XmlAccessType.FIELD) public class BundleResourceDeployment implements Serializable { @@ -73,7 +73,7 @@ public class BundleResourceDeployment implements Serializable { public static final String QUERY_FIND_BY_RESOURCE_ID_NO_FETCH = "BundleResourceDeployment.findByResourceIdNoFetch";
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_BUNDLE_RES_DEPLOY_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleResourceDeploymentHistory.java b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleResourceDeploymentHistory.java index 05c2285..7d9e405 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleResourceDeploymentHistory.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleResourceDeploymentHistory.java @@ -53,7 +53,7 @@ import javax.xml.bind.annotation.XmlType; + " WHERE brdh.resourceDeployment IN ( SELECT brd FROM BundleResourceDeployment brd WHERE brd.resource.id IN ( :resourceIds ) ) )"), @NamedQuery(name = BundleResourceDeploymentHistory.QUERY_FIND_ALL, query = "SELECT brdh FROM BundleResourceDeploymentHistory brdh") // }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_BUNDLE_RES_DEP_HIST_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_BUNDLE_RES_DEP_HIST_ID_SEQ", sequenceName = "RHQ_BUNDLE_RES_DEP_HIST_ID_SEQ") @Table(name = "RHQ_BUNDLE_RES_DEP_HIST") @XmlAccessorType(XmlAccessType.FIELD) public class BundleResourceDeploymentHistory implements Serializable { @@ -63,7 +63,7 @@ public class BundleResourceDeploymentHistory implements Serializable { public static final String QUERY_FIND_ALL = "BundleResourceDeploymentHistory.findAll";
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_BUNDLE_RES_DEP_HIST_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleType.java b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleType.java index 08c2df3..2801023 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleType.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleType.java @@ -52,7 +52,7 @@ import org.rhq.core.domain.resource.ResourceType; @NamedQueries( { @NamedQuery(name = BundleType.QUERY_FIND_ALL, query = "SELECT bt FROM BundleType bt"), // @NamedQuery(name = BundleType.QUERY_FIND_BY_NAME, query = "SELECT bt FROM BundleType bt WHERE bt.name = :name") // }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_BUNDLE_TYPE_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_BUNDLE_TYPE_ID_SEQ", sequenceName = "RHQ_BUNDLE_TYPE_ID_SEQ") @Table(name = "RHQ_BUNDLE_TYPE") @XmlAccessorType(XmlAccessType.FIELD) public class BundleType implements Serializable { @@ -62,7 +62,7 @@ public class BundleType implements Serializable { public static final String QUERY_FIND_BY_NAME = "BundleType.findByName";
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_BUNDLE_TYPE_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleVersion.java b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleVersion.java index 33c5115..a667486 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleVersion.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/bundle/BundleVersion.java @@ -82,7 +82,7 @@ import org.rhq.core.domain.tagging.Tag; @NamedQuery(name = BundleVersion.QUERY_FIND_BY_NAME, query = "SELECT bv FROM BundleVersion bv WHERE bv.name = :name "), // @NamedQuery(name = BundleVersion.QUERY_FIND_BY_BUNDLE_ID, query = "SELECT bv FROM BundleVersion bv WHERE bv.bundle.id = :bundleId ") // }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_BUNDLE_VERSION_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_BUNDLE_VERSION_ID_SEQ", sequenceName = "RHQ_BUNDLE_VERSION_ID_SEQ") @Table(name = "RHQ_BUNDLE_VERSION") @XmlAccessorType(XmlAccessType.FIELD) public class BundleVersion implements Serializable { @@ -97,7 +97,7 @@ public class BundleVersion implements Serializable { public static final String QUERY_FIND_BY_BUNDLE_ID = "BundleVersion.findByBundleId";
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_BUNDLE_VERSION_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/AffinityGroup.java b/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/AffinityGroup.java index 906fc6d..ef3a09c 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/AffinityGroup.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/AffinityGroup.java @@ -92,7 +92,7 @@ import org.rhq.core.domain.resource.Agent; + "DELETE FROM AffinityGroup ag " // + " WHERE ag.id IN ( :affinityGroupIds ) ") // }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "id", sequenceName = "RHQ_AFFINITY_GROUP_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_AFFINITY_GROUP_ID_SEQ", sequenceName = "RHQ_AFFINITY_GROUP_ID_SEQ") @Table(name = "RHQ_AFFINITY_GROUP") public class AffinityGroup implements Serializable {
@@ -110,7 +110,7 @@ public class AffinityGroup implements Serializable { public static final String QUERY_DELETE_BY_IDS = "AffinityGroup.deleteByIds";
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "id") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_AFFINITY_GROUP_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/FailoverList.java b/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/FailoverList.java index 50a3661..59a39df 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/FailoverList.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/FailoverList.java @@ -60,7 +60,7 @@ import org.rhq.core.domain.resource.Agent; @NamedQuery(name = FailoverList.QUERY_DELETE_VIA_PARTITION_EVENT, query = "DELETE FROM FailoverList fl WHERE fl.partitionEvent = :partitionEvent"), @NamedQuery(name = FailoverList.QUERY_GET_VIA_AGENT, query = "SELECT fl FROM FailoverList fl WHERE fl.agent = :agent"), @NamedQuery(name = FailoverList.QUERY_TRUNCATE, query = "DELETE FROM FailoverList") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "id", sequenceName = "RHQ_FAILOVER_LIST_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_FAILOVER_LIST_ID_SEQ", sequenceName = "RHQ_FAILOVER_LIST_ID_SEQ") @Table(name = "RHQ_FAILOVER_LIST") public class FailoverList implements Serializable {
@@ -72,7 +72,7 @@ public class FailoverList implements Serializable { public static final String QUERY_TRUNCATE = "FailoverList.truncate";
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "id") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_FAILOVER_LIST_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/FailoverListDetails.java b/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/FailoverListDetails.java index 790ba9a..b467ad7 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/FailoverListDetails.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/FailoverListDetails.java @@ -55,7 +55,7 @@ import javax.persistence.Table; @NamedQuery(name = FailoverListDetails.QUERY_DELETE_VIA_SERVER, query = "DELETE FROM FailoverListDetails fld WHERE fld.server.id = :serverId"), @NamedQuery(name = FailoverListDetails.QUERY_GET_ASSIGNED_LOADS, query = "SELECT new org.rhq.core.domain.cloud.composite.FailoverListDetailsComposite(fld.ordinal, fld.serverId, COUNT(fld.serverId)) FROM FailoverListDetails fld GROUP BY fld.ordinal, fld.serverId ORDER BY fld.ordinal ASC"), @NamedQuery(name = FailoverListDetails.QUERY_TRUNCATE, query = "DELETE FROM FailoverListDetails") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "id", sequenceName = "RHQ_FAILOVER_DETAILS_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_FAILOVER_DETAILS_ID_SEQ", sequenceName = "RHQ_FAILOVER_DETAILS_ID_SEQ") @Table(name = "RHQ_FAILOVER_DETAILS") public class FailoverListDetails implements Serializable {
@@ -69,7 +69,7 @@ public class FailoverListDetails implements Serializable { public static final String QUERY_TRUNCATE = "FailoverListDetails.truncate";
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "id") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_FAILOVER_DETAILS_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/PartitionEvent.java b/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/PartitionEvent.java index 25412fe..94d14a8 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/PartitionEvent.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/PartitionEvent.java @@ -61,7 +61,7 @@ import javax.persistence.Table; + " AND (UPPER(pe.eventDetail) LIKE :details ESCAPE :escapeChar OR :details is null) "), @NamedQuery(name = PartitionEvent.QUERY_FIND_BY_EXECUTION_STATUS, query = "SELECT pe FROM PartitionEvent pe WHERE pe.executionStatus = :executionStatus") // }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "id", sequenceName = "RHQ_PARTITION_EVENT_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_PARTITION_EVENT_ID_SEQ", sequenceName = "RHQ_PARTITION_EVENT_ID_SEQ") @Table(name = "RHQ_PARTITION_EVENT") public class PartitionEvent implements Serializable {
@@ -71,7 +71,7 @@ public class PartitionEvent implements Serializable { public static final String QUERY_FIND_BY_EXECUTION_STATUS = "PartitionEvent.findByExecutionStatus";
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "id") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_PARTITION_EVENT_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/PartitionEventDetails.java b/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/PartitionEventDetails.java index 2c6f2a8..73b1bea 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/PartitionEventDetails.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/PartitionEventDetails.java @@ -53,7 +53,7 @@ import org.rhq.core.domain.resource.Agent; + "SELECT ped " // + " FROM PartitionEventDetails ped " // + " WHERE ped.partitionEvent.id = :eventId ") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "id", sequenceName = "RHQ_PARTITION_DETAILS_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_PARTITION_DETAILS_ID_SEQ", sequenceName = "RHQ_PARTITION_DETAILS_ID_SEQ") @Table(name = "RHQ_PARTITION_DETAILS") public class PartitionEventDetails implements Serializable {
@@ -62,7 +62,7 @@ public class PartitionEventDetails implements Serializable { public static final String QUERY_FIND_BY_EVENT_ID = "PartitionEventDetails.findByEventId";
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "id") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_PARTITION_DETAILS_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/Server.java b/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/Server.java index c1adcd7..e755597 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/Server.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/Server.java @@ -90,7 +90,7 @@ import org.rhq.core.domain.resource.Agent; + " UPDATE Server s " // + " SET s.status = -1 " // negative numbers so that bitmask strat does not conflict with this one + " WHERE s.status = 0 ") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "id", sequenceName = "RHQ_SERVER_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_SERVER_ID_SEQ", sequenceName = "RHQ_SERVER_ID_SEQ") @Table(name = "RHQ_SERVER") public class Server implements Serializable {
@@ -108,7 +108,7 @@ public class Server implements Serializable { public static final String QUERY_UPDATE_STATUS_BY_NAME = "Server.updateStatusByName";
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "id") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_SERVER_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/common/SystemConfiguration.java b/modules/core/domain/src/main/java/org/rhq/core/domain/common/SystemConfiguration.java index 5d3f010..a527eea 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/common/SystemConfiguration.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/common/SystemConfiguration.java @@ -41,7 +41,7 @@ import javax.persistence.Table; @NamedQueries( { @NamedQuery(name = SystemConfiguration.QUERY_FIND_ALL, query = "SELECT c FROM SystemConfiguration AS c"), @NamedQuery(name = SystemConfiguration.FIND_PROPERTY_BY_KEY, query = "SELECT c FROM SystemConfiguration AS c WHERE c.propertyKey = :key") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_SYSTEM_CONFIG_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_SYSTEM_CONFIG_ID_SEQ", sequenceName = "RHQ_SYSTEM_CONFIG_ID_SEQ") @Table(name = "RHQ_SYSTEM_CONFIG") public class SystemConfiguration implements Serializable { public static final String QUERY_FIND_ALL = "SystemConfiguration.findAll"; @@ -50,7 +50,7 @@ public class SystemConfiguration implements Serializable { private static final long serialVersionUID = 1L;
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_SYSTEM_CONFIG_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/AbstractResourceConfigurationUpdate.java b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/AbstractResourceConfigurationUpdate.java index b45954b..16e3883 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/AbstractResourceConfigurationUpdate.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/AbstractResourceConfigurationUpdate.java @@ -51,12 +51,12 @@ import org.rhq.core.domain.resource.Resource; @DiscriminatorColumn(name = "DTYPE") @Entity @Inheritance(strategy = InheritanceType.SINGLE_TABLE) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_CONFIG_UPDATE_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_CONFIG_UPDATE_ID_SEQ", sequenceName = "RHQ_CONFIG_UPDATE_ID_SEQ") @Table(name = "RHQ_CONFIG_UPDATE") public abstract class AbstractResourceConfigurationUpdate extends AbstractConfigurationUpdate implements Serializable { private static final long serialVersionUID = 1L;
- @GeneratedValue(generator = "SEQ", strategy = GenerationType.AUTO) + @GeneratedValue(generator = "RHQ_CONFIG_UPDATE_ID_SEQ", strategy = GenerationType.AUTO) @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/Configuration.java b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/Configuration.java index 87fbcdf..591d2e9 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/Configuration.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/Configuration.java @@ -126,7 +126,7 @@ import org.jetbrains.annotations.Nullable; @NamedQuery(name = Configuration.QUERY_DELETE_CONFIGURATIONS_BY_CONFIGURATION_IDs, query = "" // + "DELETE FROM Configuration c " // + " WHERE c.id IN ( :configurationIds )") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_CONFIG_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_CONFIG_ID_SEQ", sequenceName = "RHQ_CONFIG_ID_SEQ") @Table(name = "RHQ_CONFIG") @XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement @@ -144,7 +144,7 @@ public class Configuration implements Serializable, Cloneable, AbstractPropertyM public static final String QUERY_DELETE_RAW_CONFIGURATIONS_CONFIGURATION_IDS = "Configuration.deleteRawByConfigurationIds"; public static final String QUERY_DELETE_CONFIGURATIONS_BY_CONFIGURATION_IDs = "Configuration.deleteByConfigurationIdS";
- @GeneratedValue(generator = "SEQ", strategy = GenerationType.AUTO) + @GeneratedValue(generator = "RHQ_CONFIG_ID_SEQ", strategy = GenerationType.AUTO) @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/Property.java b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/Property.java index 264dcb4..3132c5f 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/Property.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/Property.java @@ -80,7 +80,7 @@ import org.jetbrains.annotations.Nullable; @NamedQuery(name = Property.QUERY_DELETE_BY_PROPERTY_IDS, query = "" // + "DELETE FROM Property p WHERE p.id IN ( :propertyIds ) ") }) @Inheritance(strategy = InheritanceType.SINGLE_TABLE) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_CONFIG_PROPERTY_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_CONFIG_PROPERTY_ID_SEQ", sequenceName = "RHQ_CONFIG_PROPERTY_ID_SEQ") @Table(name = "RHQ_CONFIG_PROPERTY") @XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement @@ -91,7 +91,7 @@ public class Property implements Serializable, DeepCopyable<Property>, Comparabl public static final String QUERY_DELETE_BY_PROPERTY_IDS = "Property.deleteByPropertyIds";
@Column(name = "ID") - @GeneratedValue(generator = "SEQ", strategy = GenerationType.AUTO) + @GeneratedValue(generator = "RHQ_CONFIG_PROPERTY_ID_SEQ", strategy = GenerationType.AUTO) @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/RawConfiguration.java b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/RawConfiguration.java index fc493db..f1a32a3 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/RawConfiguration.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/RawConfiguration.java @@ -52,13 +52,13 @@ import javax.persistence.Transient; * the virtual host config files. */ @Entity -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_RAW_CONFIG_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_RAW_CONFIG_ID_SEQ", sequenceName = "RHQ_RAW_CONFIG_ID_SEQ") @Table(name = "RHQ_RAW_CONFIG") public class RawConfiguration implements Serializable, DeepCopyable<RawConfiguration> {
private static final long serialVersionUID = 1L;
- @GeneratedValue(generator = "SEQ", strategy = GenerationType.AUTO) + @GeneratedValue(generator = "RHQ_RAW_CONFIG_ID_SEQ", strategy = GenerationType.AUTO) @Id @Column(name = "ID") private int id; diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/ConfigurationDefinition.java b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/ConfigurationDefinition.java index ff679ae..a4bd587 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/ConfigurationDefinition.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/ConfigurationDefinition.java @@ -68,7 +68,7 @@ import org.jetbrains.annotations.Nullable; + "WHERE rt.id = :resourceTypeId AND rt.deleted = false"), @NamedQuery(name = ConfigurationDefinition.QUERY_FIND_PLUGIN_BY_RESOURCE_TYPE_ID, query = "SELECT cd FROM ResourceType rt JOIN rt.pluginConfigurationDefinition cd " + "WHERE rt.id = :resourceTypeId AND rt.deleted = false") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_CONFIG_DEF_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_CONFIG_DEF_ID_SEQ", sequenceName = "RHQ_CONFIG_DEF_ID_SEQ") @Table(name = "RHQ_CONFIG_DEF") @XmlSeeAlso({ PropertyDefinitionSimple.class, PropertyDefinitionList.class, PropertyDefinitionMap.class }) public class ConfigurationDefinition implements Serializable { @@ -79,7 +79,7 @@ public class ConfigurationDefinition implements Serializable { public static final String QUERY_FIND_PLUGIN_BY_RESOURCE_TYPE_ID = "ConfigurationDefinition.findPluginByResourceTypeId";
@Column(name = "id") - @GeneratedValue(generator = "SEQ", strategy = GenerationType.AUTO) + @GeneratedValue(generator = "RHQ_CONFIG_DEF_ID_SEQ", strategy = GenerationType.AUTO) @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/ConfigurationTemplate.java b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/ConfigurationTemplate.java index f2f813d..5f4e4c7 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/ConfigurationTemplate.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/ConfigurationTemplate.java @@ -31,7 +31,6 @@ import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; -import javax.persistence.JoinTable; import javax.persistence.ManyToOne; import javax.persistence.OneToOne; import javax.persistence.SequenceGenerator; @@ -44,7 +43,6 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable;
import org.rhq.core.domain.configuration.Configuration; -import org.rhq.core.domain.resource.ResourceType;
/** * This object represents a single template of configuration values for a given definition. Definitions may have many @@ -54,7 +52,7 @@ import org.rhq.core.domain.resource.ResourceType; * @author Greg Hinkle */ @Entity -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_CONFIG_TEMPLATE_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_CONFIG_TEMPLATE_ID_SEQ", sequenceName = "RHQ_CONFIG_TEMPLATE_ID_SEQ") @Table(name = "RHQ_CONFIG_TEMPLATE") @XmlAccessorType(XmlAccessType.FIELD) public class ConfigurationTemplate implements Serializable { @@ -62,7 +60,7 @@ public class ConfigurationTemplate implements Serializable {
public static final String DEFAULT_TEMPLATE_NAME = "default";
- @GeneratedValue(generator = "SEQ", strategy = GenerationType.AUTO) + @GeneratedValue(generator = "RHQ_CONFIG_TEMPLATE_ID_SEQ", strategy = GenerationType.AUTO) @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/PropertyDefinition.java b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/PropertyDefinition.java index 43631b7..db22c1d 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/PropertyDefinition.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/PropertyDefinition.java @@ -56,7 +56,7 @@ import org.jetbrains.annotations.NotNull; @DiscriminatorColumn(name = "dtype") @Entity @Inheritance(strategy = InheritanceType.SINGLE_TABLE) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_CONFIG_PROP_DEF_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_CONFIG_PROP_DEF_ID_SEQ", sequenceName = "RHQ_CONFIG_PROP_DEF_ID_SEQ") @Table(name = "RHQ_CONFIG_PROP_DEF") @XmlAccessorType(XmlAccessType.FIELD) @XmlSeeAlso( { PropertyDefinitionSimple.class, PropertyDefinitionList.class, PropertyDefinitionMap.class }) @@ -65,7 +65,7 @@ public class PropertyDefinition implements Serializable { private static final long serialVersionUID = 1L;
@Column(name = "id") - @GeneratedValue(generator = "SEQ", strategy = GenerationType.AUTO) + @GeneratedValue(generator = "RHQ_CONFIG_PROP_DEF_ID_SEQ", strategy = GenerationType.AUTO) @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/PropertyDefinitionEnumeration.java b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/PropertyDefinitionEnumeration.java index 2587038..019dc6b 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/PropertyDefinitionEnumeration.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/PropertyDefinitionEnumeration.java @@ -43,14 +43,14 @@ import org.jetbrains.annotations.NotNull; * @author Jason Dobies */ @Entity -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_CONF_PROP_DEF_ENUM_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_CONF_PROP_DEF_ENUM_ID_SEQ", sequenceName = "RHQ_CONF_PROP_DEF_ENUM_ID_SEQ") @Table(name = "RHQ_CONF_PROP_DEF_ENUM") @XmlAccessorType(XmlAccessType.FIELD) public class PropertyDefinitionEnumeration implements Serializable { private static final long serialVersionUID = 1L;
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_CONF_PROP_DEF_ENUM_ID_SEQ") @Id private long id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/PropertyGroupDefinition.java b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/PropertyGroupDefinition.java index 73e28fb..a1df948 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/PropertyGroupDefinition.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/PropertyGroupDefinition.java @@ -41,13 +41,13 @@ import org.jetbrains.annotations.NotNull; * @author Greg Hinkle */ @Entity -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_CONFIG_PROP_GRP_DEF_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_CONFIG_PROP_GRP_DEF_ID_SEQ", sequenceName = "RHQ_CONFIG_PROP_GRP_DEF_ID_SEQ") @Table(name = "RHQ_CONFIG_PROP_GRP_DEF") public class PropertyGroupDefinition implements Serializable { private static final long serialVersionUID = 1L;
@Column(name = "ID") - @GeneratedValue(generator = "SEQ", strategy = GenerationType.AUTO) + @GeneratedValue(generator = "RHQ_CONFIG_PROP_GRP_DEF_ID_SEQ", strategy = GenerationType.AUTO) @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/PropertyOptionsSource.java b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/PropertyOptionsSource.java index fb1f347..70c9a1f 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/PropertyOptionsSource.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/PropertyOptionsSource.java @@ -33,8 +33,6 @@ import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; -import javax.persistence.OneToOne; import javax.persistence.SequenceGenerator; import javax.persistence.Table; import javax.xml.bind.annotation.XmlAccessType; @@ -46,12 +44,12 @@ import javax.xml.bind.annotation.XmlAccessorType; */ @Entity @Table(name="RHQ_CONFIG_PD_OSRC") -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_CONFIG_PD_OSRC_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_CONFIG_PD_OSRC_ID_SEQ", sequenceName = "RHQ_CONFIG_PD_OSRC_ID_SEQ") @XmlAccessorType(XmlAccessType.FIELD) public class PropertyOptionsSource implements Serializable{
@Id - @GeneratedValue(generator = "SEQ", strategy = GenerationType.AUTO) + @GeneratedValue(generator = "RHQ_CONFIG_PD_OSRC_ID_SEQ", strategy = GenerationType.AUTO) private int id;
@Column(name="LINK_TO_TARGET") diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/constraint/Constraint.java b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/constraint/Constraint.java index 720a25f..2d9ec61 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/constraint/Constraint.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/definition/constraint/Constraint.java @@ -49,7 +49,7 @@ import org.rhq.core.domain.configuration.definition.PropertyDefinitionSimple; @DiscriminatorColumn(name = "dtype", discriminatorType = DiscriminatorType.STRING) @Entity @Inheritance(strategy = InheritanceType.SINGLE_TABLE) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_CONFIG_PROP_CONSTR_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_CONFIG_PROP_CONSTR_ID_SEQ", sequenceName = "RHQ_CONFIG_PROP_CONSTR_ID_SEQ") @Table(name = "RHQ_CONFIG_PROP_CONSTR") public abstract class Constraint implements Serializable { private static final long serialVersionUID = 1L; @@ -57,7 +57,7 @@ public abstract class Constraint implements Serializable { protected static final String DELIMITER = "#";
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_CONFIG_PROP_CONSTR_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/group/AbstractGroupConfigurationUpdate.java b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/group/AbstractGroupConfigurationUpdate.java index ef53e4f..41340c9 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/group/AbstractGroupConfigurationUpdate.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/configuration/group/AbstractGroupConfigurationUpdate.java @@ -42,13 +42,13 @@ import org.rhq.core.domain.resource.group.ResourceGroup; @DiscriminatorColumn(name = "DTYPE") @Entity @Inheritance(strategy = InheritanceType.SINGLE_TABLE) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_CONFIG_GROUP_UPDATE_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_CONFIG_GROUP_UPDATE_ID_SEQ", sequenceName = "RHQ_CONFIG_GROUP_UPDATE_ID_SEQ") @Table(name = "RHQ_CONFIG_GROUP_UPDATE") public abstract class AbstractGroupConfigurationUpdate extends AbstractConfigurationUpdate implements Serializable {
private static final long serialVersionUID = 1L;
- @GeneratedValue(generator = "SEQ", strategy = GenerationType.AUTO) + @GeneratedValue(generator = "RHQ_CONFIG_GROUP_UPDATE_ID_SEQ", strategy = GenerationType.AUTO) @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/Advisory.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/Advisory.java index 7ab63a0..1f9fcbe 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/Advisory.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/Advisory.java @@ -39,7 +39,7 @@ import javax.persistence.Table; + " ) " + " FROM Advisory a " + " WHERE a.id = :id ") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_ADVISORY_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_ADVISORY_ID_SEQ", sequenceName = "RHQ_ADVISORY_ID_SEQ") @Table(name = "RHQ_ADVISORY") public class Advisory implements Serializable {
@@ -52,7 +52,7 @@ public class Advisory implements Serializable { public static final String QUERY_FIND_BY_ADV_ID = "Advisory.queryFindByAdvId";
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_ADVISORY_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/AdvisoryBuglist.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/AdvisoryBuglist.java index 7d70613..fb39a5b 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/AdvisoryBuglist.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/AdvisoryBuglist.java @@ -51,7 +51,7 @@ import javax.xml.bind.annotation.XmlTransient; @NamedQuery(name = AdvisoryBuglist.DELETE_BY_ADV_ID, query = "DELETE AdvisoryBuglist ab WHERE ab.advisory.id = :advId"), @NamedQuery(name = AdvisoryBuglist.FIND_ADVISORY_BUGLIST, query = "SELECT ab FROM AdvisoryBuglist AS ab " + "WHERE ab.advisory.id = :advId AND ab.bugid = :buginfo") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_ADVISORY_BUGLIST_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_ADVISORY_BUGLIST_ID_SEQ", sequenceName = "RHQ_ADVISORY_BUGLIST_ID_SEQ") @Table(name = "RHQ_ADVISORY_BUGLIST") public class AdvisoryBuglist implements Serializable {
@@ -65,7 +65,7 @@ public class AdvisoryBuglist implements Serializable { * @IdClass. */ @Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_ADVISORY_BUGLIST_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/AdvisoryCVE.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/AdvisoryCVE.java index fd9d84e..8317604 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/AdvisoryCVE.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/AdvisoryCVE.java @@ -47,7 +47,7 @@ import javax.persistence.Table; @NamedQueries( { @NamedQuery(name = AdvisoryCVE.FIND_CVE_BY_ADV_ID, query = "SELECT ac FROM AdvisoryCVE AS ac WHERE ac.advisory.id = :advId"), @NamedQuery(name = AdvisoryCVE.DELETE_BY_ADV_ID, query = "DELETE AdvisoryCVE ac WHERE ac.advisory.id = :advId") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_ADVISORY_CVE_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_ADVISORY_CVE_ID_SEQ", sequenceName = "RHQ_ADVISORY_CVE_ID_SEQ") @Table(name = "RHQ_ADVISORY_CVE") public class AdvisoryCVE implements Serializable {
@@ -61,7 +61,7 @@ public class AdvisoryCVE implements Serializable { * @IdClass. */ @Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_ADVISORY_CVE_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/AdvisoryPackage.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/AdvisoryPackage.java index 3b23f4f..ffeb809 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/AdvisoryPackage.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/AdvisoryPackage.java @@ -51,7 +51,7 @@ import javax.xml.bind.annotation.XmlTransient; @NamedQuery(name = AdvisoryPackage.DELETE_PACKAGES_BY_ADV_ID, query = "DELETE AdvisoryPackage ap WHERE ap.advisory.id = :advId"), @NamedQuery(name = AdvisoryPackage.FIND_ADVISORY_PACKAGE, query = "SELECT ap FROM AdvisoryPackage AS ap " + "WHERE ap.advisory.id = :advId AND ap.pkg.id = :pkgVerId") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_ADVISORY_PACKAGE_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_ADVISORY_PACKAGE_ID_SEQ", sequenceName = "RHQ_ADVISORY_PACKAGE_ID_SEQ") @Table(name = "RHQ_ADVISORY_PACKAGE") public class AdvisoryPackage implements Serializable {
@@ -66,7 +66,7 @@ public class AdvisoryPackage implements Serializable { * @IdClass. */ @Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_ADVISORY_PACKAGE_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/Architecture.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/Architecture.java index bac4046..661822f 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/Architecture.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/Architecture.java @@ -47,7 +47,7 @@ import org.rhq.core.domain.resource.Resource; @NamedQuery(name = Architecture.QUERY_FIND_BY_NAME, query = "SELECT arch FROM Architecture arch WHERE arch.name = :name"), @NamedQuery(name = Architecture.QUERY_FIND_ALL, query = "SELECT arch FROM Architecture arch"), @NamedQuery(name = Architecture.QUERY_DYNAMIC_CONFIG_VALUES, query = "SELECT arch.name, arch.name FROM Architecture arch") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_ARCHITECTURE_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_ARCHITECTURE_ID_SEQ", sequenceName = "RHQ_ARCHITECTURE_ID_SEQ") @Table(name = "RHQ_ARCHITECTURE") public class Architecture implements Serializable {
@@ -59,7 +59,7 @@ public class Architecture implements Serializable { public static final String QUERY_DYNAMIC_CONFIG_VALUES = "Architecture.dynamicConfigValues";
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_ARCHITECTURE_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/CVE.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/CVE.java index 5655fd9..fd3e8a4 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/CVE.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/CVE.java @@ -42,7 +42,7 @@ import javax.persistence.Table; @Entity @NamedQueries({ @NamedQuery(name = CVE.DELETE_BY_CVE_ID, query = "DELETE CVE cve WHERE cve.id = :cveId"), @NamedQuery(name = CVE.FIND_BY_CVE_ID, query = "SELECT cve FROM CVE as cve WHERE cve.id = :cveId") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_CVE_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_CVE_ID_SEQ", sequenceName = "RHQ_CVE_ID_SEQ") @Table(name = "RHQ_CVE") public class CVE implements Serializable {
@@ -51,7 +51,7 @@ public class CVE implements Serializable { public static final String DELETE_BY_CVE_ID = "CVE.deleteByCVEId";
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_CVE_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/ContentServiceRequest.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/ContentServiceRequest.java index 3f1159b..c0909e6 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/ContentServiceRequest.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/ContentServiceRequest.java @@ -66,7 +66,7 @@ import org.rhq.core.domain.resource.Resource; + " FROM ContentServiceRequest AS csr WHERE csr.id = :id"),
@NamedQuery(name = ContentServiceRequest.QUERY_DELETE_BY_RESOURCES, query = "DELETE FROM ContentServiceRequest csr WHERE csr.resource.id IN ( :resourceIds ) )") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_CONTENT_REQ_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_CONTENT_REQ_ID_SEQ", sequenceName = "RHQ_CONTENT_REQ_ID_SEQ") @Table(name = "RHQ_CONTENT_REQ") public class ContentServiceRequest implements Serializable {
@@ -80,7 +80,7 @@ public class ContentServiceRequest implements Serializable { public static final String QUERY_DELETE_BY_RESOURCES = "ContentServiceRequest.deleteByResources";
@Column(name = "ID", nullable = false) - @GeneratedValue(generator = "SEQ", strategy = GenerationType.AUTO) + @GeneratedValue(generator = "RHQ_CONTENT_REQ_ID_SEQ", strategy = GenerationType.AUTO) @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/ContentSource.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/ContentSource.java index ed03b52..d5078fc 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/ContentSource.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/ContentSource.java @@ -76,7 +76,7 @@ import org.rhq.core.domain.configuration.Configuration; + " ( SELECT ccs.contentSource.id " // + " FROM RepoContentSource ccs " // + " WHERE ccs.repo.id = :repoId ) ") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_CONTENT_SOURCE_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_CONTENT_SOURCE_ID_SEQ", sequenceName = "RHQ_CONTENT_SOURCE_ID_SEQ") @Table(name = "RHQ_CONTENT_SOURCE") public class ContentSource implements Serializable { public static final String QUERY_FIND_ALL = "ContentSource.findAll"; @@ -89,7 +89,7 @@ public class ContentSource implements Serializable { private static final long serialVersionUID = 1L;
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_CONTENT_SOURCE_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/ContentSourceSyncResults.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/ContentSourceSyncResults.java index 540e9eb..5ae1b76 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/ContentSourceSyncResults.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/ContentSourceSyncResults.java @@ -53,7 +53,7 @@ import javax.persistence.Table; + " AND status = 'INPROGRESS' " + " ORDER BY cssr.startTime DESC "), @NamedQuery(name = ContentSourceSyncResults.QUERY_GET_ALL_BY_CONTENT_SOURCE_ID, query = "SELECT cssr " + " FROM ContentSourceSyncResults cssr " + " WHERE cssr.contentSource.id = :contentSourceId ") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_CONTENT_SRC_SYNC_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_CONTENT_SRC_SYNC_ID_SEQ", sequenceName = "RHQ_CONTENT_SRC_SYNC_ID_SEQ") @Table(name = "RHQ_CONTENT_SRC_SYNC") public class ContentSourceSyncResults implements ContentSyncResults, Serializable { public static final String QUERY_GET_INPROGRESS_BY_CONTENT_SOURCE_ID = "ContentSourceSyncResults.getInProgressByCSId"; @@ -62,7 +62,7 @@ public class ContentSourceSyncResults implements ContentSyncResults, Serializabl private static final long serialVersionUID = 1L;
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_CONTENT_SRC_SYNC_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/ContentSourceType.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/ContentSourceType.java index 7802ea1..5cbbc36 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/ContentSourceType.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/ContentSourceType.java @@ -63,7 +63,7 @@ import org.rhq.core.domain.configuration.definition.ConfigurationDefinition; + " LEFT JOIN FETCH d.templates t " + " WHERE cst.name = :name"), @NamedQuery(name = ContentSourceType.QUERY_FIND_BY_NAME, query = "SELECT cst " + " FROM ContentSourceType cst " + " WHERE cst.name = :name") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_CONTENT_SOURCE_TYPE_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_CONTENT_SOURCE_TYPE_ID_SEQ", sequenceName = "RHQ_CONTENT_SOURCE_TYPE_ID_SEQ") @Table(name = "RHQ_CONTENT_SOURCE_TYPE") public class ContentSourceType implements Serializable {
@@ -74,7 +74,7 @@ public class ContentSourceType implements Serializable { private static final long serialVersionUID = 1L;
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_CONTENT_SOURCE_TYPE_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/Distribution.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/Distribution.java index e29417b..f6b576b 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/Distribution.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/Distribution.java @@ -55,7 +55,7 @@ import org.hibernate.annotations.NamedQuery; @NamedQuery(name = Distribution.QUERY_FIND_BY_DIST_LABEL, query = "SELECT dt FROM Distribution dt WHERE dt.label = :label"), @NamedQuery(name = Distribution.QUERY_FIND_BY_DIST_PATH, query = "SELECT dt FROM Distribution dt WHERE dt.basePath = :path"), @NamedQuery(name = Distribution.QUERY_DELETE_BY_DIST_ID, query = "DELETE Distribution dt WHERE dt.id = :distid") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_DISTRIBUTION_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_DISTRIBUTION_ID_SEQ", sequenceName = "RHQ_DISTRIBUTION_ID_SEQ") @Table(name = "RHQ_DISTRIBUTION") public class Distribution implements Serializable {
@@ -67,7 +67,7 @@ public class Distribution implements Serializable { public static final String QUERY_DELETE_BY_DIST_ID = "Distribution.deleteByDistId";
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_DISTRIBUTION_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/DistributionFile.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/DistributionFile.java index 3de37d4..3cc3d15 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/DistributionFile.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/DistributionFile.java @@ -49,7 +49,7 @@ import javax.xml.bind.annotation.XmlTransient; @NamedQueries({ @NamedQuery(name = DistributionFile.SELECT_BY_DIST_ID, query = "SELECT df from DistributionFile df WHERE df.distribution.id = :distId"), @NamedQuery(name = DistributionFile.DELETE_BY_DIST_ID, query = "DELETE DistributionFile df WHERE df.distribution.id = :distId") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_DISTRIBUTION_FILE_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_DISTRIBUTION_FILE_ID_SEQ", sequenceName = "RHQ_DISTRIBUTION_FILE_ID_SEQ") @Table(name = "RHQ_DISTRIBUTION_FILE") public class DistributionFile { public static final String SELECT_BY_DIST_ID = "DistributionFile.selectByDistId"; @@ -63,7 +63,7 @@ public class DistributionFile { * @IdClass. */ @Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_DISTRIBUTION_FILE_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/DistributionType.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/DistributionType.java index d54a192..fcce5b1 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/DistributionType.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/DistributionType.java @@ -45,7 +45,7 @@ import javax.persistence.Table; @NamedQueries({ @NamedQuery(name = DistributionType.QUERY_FIND_BY_NAME, query = "SELECT dt FROM DistributionType dt WHERE dt.name = :name"), @NamedQuery(name = DistributionType.QUERY_DELETE_BY_NAME, query = "DELETE FROM DistributionType dt where dt.name = :name") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_DISTRIBUTION_TYPE_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_DISTRIBUTION_TYPE_ID_SEQ", sequenceName = "RHQ_DISTRIBUTION_TYPE_ID_SEQ") @Table(name = "RHQ_DISTRIBUTION_TYPE") public class DistributionType implements Serializable {
@@ -55,7 +55,7 @@ public class DistributionType implements Serializable { public static final String QUERY_DELETE_BY_NAME = "DistributionType.deleteByName";
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_DISTRIBUTION_TYPE_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/InstalledPackage.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/InstalledPackage.java index e259317..179561d 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/InstalledPackage.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/InstalledPackage.java @@ -70,7 +70,7 @@ import org.rhq.core.domain.resource.Resource; + "WHERE res.id = :resourceId " + " AND gp.id = :generalPackageId"), @NamedQuery(name = InstalledPackage.QUERY_DELETE_BY_RESOURCES, query = "DELETE FROM InstalledPackage ip " + " WHERE ip.resource.id IN ( :resourceIds )") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_INSTALLED_PACKAGE_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_INSTALLED_PACKAGE_ID_SEQ", sequenceName = "RHQ_INSTALLED_PACKAGE_ID_SEQ") @Table(name = "RHQ_INSTALLED_PACKAGE") public class InstalledPackage implements Serializable { // Constants -------------------------------------------- @@ -90,7 +90,7 @@ public class InstalledPackage implements Serializable { public static final String QUERY_DELETE_BY_RESOURCES = "InstalledPackage.deleteByResources";
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_INSTALLED_PACKAGE_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/InstalledPackageHistory.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/InstalledPackageHistory.java index a882543..93fbc3c 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/InstalledPackageHistory.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/InstalledPackageHistory.java @@ -72,7 +72,7 @@ import org.rhq.core.domain.resource.Resource; + "WHERE iph.id = :id"), @NamedQuery(name = InstalledPackageHistory.QUERY_DELETE_BY_RESOURCES, query = "DELETE FROM InstalledPackageHistory iph " + " WHERE iph.resource.id IN ( :resourceIds ) )") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_INSTALLED_PKG_HIST_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_INSTALLED_PKG_HIST_ID_SEQ", sequenceName = "RHQ_INSTALLED_PKG_HIST_ID_SEQ") @Table(name = "RHQ_INSTALLED_PKG_HIST") public class InstalledPackageHistory implements Serializable {
@@ -87,7 +87,7 @@ public class InstalledPackageHistory implements Serializable { public static final String QUERY_DELETE_BY_RESOURCES = "InstalledPackageHistory.deleteByResources";
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_INSTALLED_PKG_HIST_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/Package.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/Package.java index 1018b7c..1a33c13 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/Package.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/Package.java @@ -62,7 +62,7 @@ import org.hibernate.annotations.NamedQuery; @NamedQuery(name = Package.QUERY_FIND_BY_NAME_PKG_TYPE_RESOURCE_TYPE, query = "SELECT p FROM Package AS p " + "WHERE p.name = :name " + "AND p.packageType.name = :packageTypeName " + "AND p.packageType.resourceType.id = :resourceTypeId") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_PACKAGE_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_PACKAGE_ID_SEQ", sequenceName = "RHQ_PACKAGE_ID_SEQ") @Table(name = "RHQ_PACKAGE") public class Package implements Serializable { // Constants -------------------------------------------- @@ -75,7 +75,7 @@ public class Package implements Serializable { // Attributes --------------------------------------------
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_PACKAGE_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageBitsBlob.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageBitsBlob.java index 2e48354..41b68be 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageBitsBlob.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageBitsBlob.java @@ -54,7 +54,7 @@ import javax.xml.bind.annotation.XmlTransient; * @author Jay Shaughnessy */ @Entity -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_PACKAGE_BITS_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_PACKAGE_BITS_ID_SEQ", sequenceName = "RHQ_PACKAGE_BITS_ID_SEQ") @Table(name = PackageBits.TABLE_NAME) public class PackageBitsBlob implements Serializable { public static final String TABLE_NAME = "RHQ_PACKAGE_BITS"; @@ -62,7 +62,7 @@ public class PackageBitsBlob implements Serializable { private static final long serialVersionUID = 1L;
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_PACKAGE_BITS_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageInstallationStep.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageInstallationStep.java index ee4450a..93ff702 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageInstallationStep.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageInstallationStep.java @@ -53,7 +53,7 @@ import org.rhq.core.domain.content.transfer.ContentResponseResult; + "WHERE pis.installedPackageHistory.id = :installedPackageHistoryId")
}) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_PACKAGE_INST_STEP_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_PACKAGE_INST_STEP_ID_SEQ", sequenceName = "RHQ_PACKAGE_INST_STEP_ID_SEQ") @Table(name = "RHQ_PACKAGE_INST_STEP") public class PackageInstallationStep implements Serializable { // Constants -------------------------------------------- @@ -69,7 +69,7 @@ public class PackageInstallationStep implements Serializable { * Database assigned ID. */ @Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_PACKAGE_INST_STEP_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageType.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageType.java index 98caeb5..72ab637 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageType.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageType.java @@ -72,7 +72,7 @@ import org.rhq.core.domain.resource.ResourceType; + "LEFT JOIN FETCH pt.deploymentConfigurationDefinition cd " + "LEFT JOIN FETCH cd.templates cts " + "WHERE rt.id = :typeId AND pt.isCreationData = true"), @NamedQuery(name = PackageType.QUERY_DYNAMIC_CONFIG_VALUES, query = "SELECT pt.resourceType.plugin || ' - ' || pt.resourceType.name || ' - ' || pt.displayName, pt.name FROM PackageType AS pt") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_PACKAGE_TYPE_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_PACKAGE_TYPE_ID_SEQ", sequenceName = "RHQ_PACKAGE_TYPE_ID_SEQ") @Table(name = "RHQ_PACKAGE_TYPE") @XmlAccessorType(XmlAccessType.FIELD) public class PackageType implements Serializable { @@ -92,7 +92,7 @@ public class PackageType implements Serializable { // Attributes --------------------------------------------
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_PACKAGE_TYPE_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageVersion.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageVersion.java index 591ce68..54dc416 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageVersion.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/PackageVersion.java @@ -264,7 +264,7 @@ import org.rhq.core.domain.util.OSGiVersionComparator; + " (SELECT pv2.id, (SELECT COUNT(rpv) FROM RepoPackageVersion rpv WHERE rpv.packageVersion.id = pv2.id)" + " FROM PackageVersion pv2" + " WHERE pv2.id IN ( :packageVersionIds )" + " AND pv2.id IN (SELECT rpv.packageVersion.id FROM RepoPackageVersion rpv WHERE rpv.repo.id = :repoId))") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_PACKAGE_VERSION_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_PACKAGE_VERSION_ID_SEQ", sequenceName = "RHQ_PACKAGE_VERSION_ID_SEQ") @Table(name = "RHQ_PACKAGE_VERSION") public class PackageVersion implements Serializable { // Constants -------------------------------------------- @@ -351,7 +351,7 @@ public class PackageVersion implements Serializable { // Attributes --------------------------------------------
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_PACKAGE_VERSION_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/Repo.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/Repo.java index f41efd2..c0fe712 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/Repo.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/Repo.java @@ -130,7 +130,7 @@ import org.rhq.core.domain.resource.Resource; @NamedQuery(name = Repo.QUERY_UPDATE_REMOVE_OWNER_FROM_REPOS_OWNED_BY_SUBJECT, query = "" + "UPDATE Repo r SET r.owner = null WHERE r.owner.id = :ownerId") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_REPO_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_REPO_ID_SEQ", sequenceName = "RHQ_REPO_ID_SEQ") @Table(name = "RHQ_REPO") public class Repo implements Serializable {
@@ -161,7 +161,7 @@ public class Repo implements Serializable { // Attributes --------------------------------------------
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_REPO_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoGroup.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoGroup.java index 73b6dec..2166e4c 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoGroup.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoGroup.java @@ -26,6 +26,7 @@ import java.io.Serializable; import java.util.HashSet; import java.util.Set;
+import javax.persistence.CascadeType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; @@ -34,12 +35,11 @@ import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; import javax.persistence.OneToMany; import javax.persistence.SequenceGenerator; import javax.persistence.Table; -import javax.persistence.CascadeType; -import javax.persistence.NamedQueries; -import javax.persistence.NamedQuery;
/** * A RepoGroup represents a set of related {@link Repo}s. Repos can be tied together @@ -52,7 +52,7 @@ import javax.persistence.NamedQuery; @NamedQueries( @NamedQuery(name = RepoGroup.QUERY_FIND_BY_NAME, query = "SELECT g FROM RepoGroup g WHERE g.name = :name") ) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_REPO_GROUP_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_REPO_GROUP_ID_SEQ", sequenceName = "RHQ_REPO_GROUP_ID_SEQ") @Table(name = "RHQ_REPO_GROUP") public class RepoGroup implements Serializable { // Constants -------------------------------------------- @@ -64,7 +64,7 @@ public class RepoGroup implements Serializable { // Attributes --------------------------------------------
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_REPO_GROUP_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoGroupType.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoGroupType.java index 121030b..526e455 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoGroupType.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoGroupType.java @@ -32,11 +32,11 @@ import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; import javax.persistence.OneToMany; import javax.persistence.SequenceGenerator; import javax.persistence.Table; -import javax.persistence.NamedQueries; -import javax.persistence.NamedQuery;
/** * Defines a type of (@link RepoGroup) e.g. Channel families in RHN map to a type of @@ -48,7 +48,7 @@ import javax.persistence.NamedQuery; @NamedQueries( @NamedQuery(name = RepoGroupType.QUERY_FIND_BY_NAME, query = "SELECT t FROM RepoGroupType t WHERE t.name = :name") ) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_REPO_GROUP_TYPE_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_REPO_GROUP_TYPE_ID_SEQ", sequenceName = "RHQ_REPO_GROUP_TYPE_ID_SEQ") @Table(name = "RHQ_REPO_GROUP_TYPE") public class RepoGroupType implements Serializable {
@@ -59,7 +59,7 @@ public class RepoGroupType implements Serializable { // Attributes --------------------------------------------
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_REPO_GROUP_TYPE_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoRelationship.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoRelationship.java index 8d7685a..6fd6633 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoRelationship.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoRelationship.java @@ -34,11 +34,11 @@ import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; import javax.persistence.OneToMany; import javax.persistence.SequenceGenerator; import javax.persistence.Table; -import javax.persistence.NamedQueries; -import javax.persistence.NamedQuery;
/** * A RepoRelationship represents relationship with a {@link Repo} @@ -52,7 +52,7 @@ import javax.persistence.NamedQuery; @NamedQueries({ @NamedQuery(name = RepoRelationship.DELETE_BY_RELATED_REPO_ID, query = "DELETE RepoRelationship rr WHERE rr.relatedRepo.id = :relatedRepoId") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_REPO_RELATION_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_REPO_RELATION_ID_SEQ", sequenceName = "RHQ_REPO_RELATION_ID_SEQ") @Table(name = "RHQ_REPO_RELATION") public class RepoRelationship implements Serializable { // Constants -------------------------------------------- @@ -64,7 +64,7 @@ public class RepoRelationship implements Serializable { // Attributes --------------------------------------------
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_REPO_RELATION_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoRelationshipType.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoRelationshipType.java index 5e3b853..f5e3346 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoRelationshipType.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoRelationshipType.java @@ -32,11 +32,11 @@ import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; import javax.persistence.OneToMany; import javax.persistence.SequenceGenerator; import javax.persistence.Table; -import javax.persistence.NamedQueries; -import javax.persistence.NamedQuery;
/** * Defines a type of (@link RepoRelationship) e.g. Clone, Parent-child are types of @@ -49,7 +49,7 @@ import javax.persistence.NamedQuery; @NamedQuery(name = RepoRelationshipType.QUERY_FIND_BY_NAME, query = "SELECT r FROM RepoRelationshipType r WHERE r.name = :name") })
-@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_REPO_RELATION_TYPE_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_REPO_RELATION_TYPE_ID_SEQ", sequenceName = "RHQ_REPO_RELATION_TYPE_ID_SEQ") @Table(name = "RHQ_REPO_RELATION_TYPE") public class RepoRelationshipType implements Serializable {
@@ -60,7 +60,7 @@ public class RepoRelationshipType implements Serializable { // Attributes --------------------------------------------
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_REPO_RELATION_TYPE_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoSyncResults.java b/modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoSyncResults.java index 5fb231a..675f0d4 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoSyncResults.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/content/RepoSyncResults.java @@ -52,7 +52,7 @@ import javax.persistence.Table; + " ORDER BY rssr.startTime DESC "), @NamedQuery(name = RepoSyncResults.QUERY_GET_ALL_BY_REPO_ID, query = "SELECT rssr " + " FROM RepoSyncResults rssr " + " WHERE rssr.repo.id = :repoId ") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_REPO_SYNC_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_REPO_SYNC_ID_SEQ", sequenceName = "RHQ_REPO_SYNC_ID_SEQ") @Table(name = "RHQ_REPO_SYNC") public class RepoSyncResults implements Serializable, ContentSyncResults { public static final String QUERY_GET_INPROGRESS_BY_REPO_ID = "RepoSyncResults.getInProgressByRepoId"; @@ -61,7 +61,7 @@ public class RepoSyncResults implements Serializable, ContentSyncResults { private static final long serialVersionUID = 1L;
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_REPO_SYNC_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftDefinition.java b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftDefinition.java index a9b0ad3..6b37edb 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftDefinition.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftDefinition.java @@ -65,12 +65,12 @@ import org.rhq.core.domain.util.StringUtils; */ @Entity @Table(name = "RHQ_DRIFT_DEFINITION") -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_DRIFT_DEFINITION_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_DRIFT_DEFINITION_ID_SEQ", sequenceName = "RHQ_DRIFT_DEFINITION_ID_SEQ") public class DriftDefinition implements Serializable { private static final long serialVersionUID = 1L;
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_DRIFT_DEFINITION_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftDefinitionTemplate.java b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftDefinitionTemplate.java index d7cfc4d..5fac548 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftDefinitionTemplate.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/DriftDefinitionTemplate.java @@ -64,13 +64,13 @@ import org.rhq.core.domain.resource.ResourceType; */ @Entity @Table(name = "RHQ_DRIFT_DEF_TEMPLATE") -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_DRIFT_DEF_TEMPLATE_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_DRIFT_DEF_TEMPLATE_ID_SEQ", sequenceName = "RHQ_DRIFT_DEF_TEMPLATE_ID_SEQ") public class DriftDefinitionTemplate implements Serializable { private static final long serialVersionUID = 1L;
@Id @Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_DRIFT_DEF_TEMPLATE_ID_SEQ") private int id;
@Column(name = "CTIME", nullable = false) diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/JPADrift.java b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/JPADrift.java index c3d6bb3..219fbe7 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/JPADrift.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/JPADrift.java @@ -57,7 +57,7 @@ import javax.persistence.Table; + " FROM JPADriftChangeSet dcs " // + " WHERE dcs.driftDefinition.name = :driftDefinitionName AND dcs.resource.id = :resourceId)") }) @Table(name = "RHQ_DRIFT") -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_DRIFT_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_DRIFT_ID_SEQ", sequenceName = "RHQ_DRIFT_ID_SEQ") public class JPADrift implements Serializable, Drift<JPADriftChangeSet, JPADriftFile> { private static final long serialVersionUID = 1L;
@@ -65,7 +65,7 @@ public class JPADrift implements Serializable, Drift<JPADriftChangeSet, JPADrift public static final String QUERY_DELETE_BY_DRIFTDEF_RESOURCE = "JPADrift.deleteByDriftDefResource";
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_DRIFT_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/JPADriftChangeSet.java b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/JPADriftChangeSet.java index c43324d..68177d4 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/JPADriftChangeSet.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/JPADriftChangeSet.java @@ -100,7 +100,7 @@ import org.rhq.core.domain.resource.Resource; + " WHERE dc.resource.id = :resourceId AND dc.name = :driftDefinitionName)" // ) }) @Table(name = "RHQ_DRIFT_CHANGE_SET") -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_DRIFT_CHANGE_SET_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_DRIFT_CHANGE_SET_ID_SEQ", sequenceName = "RHQ_DRIFT_CHANGE_SET_ID_SEQ") public class JPADriftChangeSet implements Serializable, DriftChangeSet<JPADrift> { private static final long serialVersionUID = 1L;
@@ -108,7 +108,7 @@ public class JPADriftChangeSet implements Serializable, DriftChangeSet<JPADrift> public static final String QUERY_DELETE_BY_DRIFTDEF_RESOURCE = "JPADriftChangeSet.deleteByDriftDefResource";
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_DRIFT_CHANGE_SET_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/JPADriftSet.java b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/JPADriftSet.java index f40bde2..bd07c0a 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/drift/JPADriftSet.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/drift/JPADriftSet.java @@ -38,12 +38,12 @@ import javax.persistence.Table;
@Entity @Table(name = "RHQ_DRIFT_SET") -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_DRIFT_SET_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_DRIFT_SET_ID_SEQ", sequenceName = "RHQ_DRIFT_SET_ID_SEQ") public class JPADriftSet implements Serializable { private static final long serialVersionUID = 1L;
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_DRIFT_SET_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/event/Event.java b/modules/core/domain/src/main/java/org/rhq/core/domain/event/Event.java index d8c41b3..1c5a79d 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/event/Event.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/event/Event.java @@ -89,7 +89,8 @@ import org.rhq.core.domain.resource.Resource; + "GROUP BY ev.severity") }) @Entity @Table(name = Event.TABLE_NAME) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "idGenerator", sequenceName = Event.TABLE_NAME + "_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = Event.TABLE_NAME + + "_ID_SEQ", sequenceName = Event.TABLE_NAME + "_ID_SEQ") public class Event implements Serializable { private static final long serialVersionUID = 1L;
@@ -108,7 +109,7 @@ public class Event implements Serializable {
@Id @Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "idGenerator") + @GeneratedValue(strategy = GenerationType.AUTO, generator = Event.TABLE_NAME + "_ID_SEQ") private int id;
@JoinColumn(name = "EVENT_SOURCE_ID", referencedColumnName = "ID", nullable = false) diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/event/EventDefinition.java b/modules/core/domain/src/main/java/org/rhq/core/domain/event/EventDefinition.java index 7f88007..bfab674 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/event/EventDefinition.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/event/EventDefinition.java @@ -46,7 +46,8 @@ import org.rhq.core.domain.resource.ResourceType; */ @Entity @Table(name = EventDefinition.TABLE_NAME) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "idGenerator", sequenceName = EventDefinition.TABLE_NAME + "_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = EventDefinition.TABLE_NAME + + "_ID_SEQ", sequenceName = EventDefinition.TABLE_NAME + "_ID_SEQ") public class EventDefinition implements Serializable { private static final long serialVersionUID = 1L;
@@ -54,7 +55,7 @@ public class EventDefinition implements Serializable {
@Id @Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "idGenerator") + @GeneratedValue(strategy = GenerationType.AUTO, generator = EventDefinition.TABLE_NAME + "_ID_SEQ") private int id;
@JoinColumn(name = "RESOURCE_TYPE_ID", referencedColumnName = "ID", nullable = false) diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/event/EventSource.java b/modules/core/domain/src/main/java/org/rhq/core/domain/event/EventSource.java index 170b0d2..ae58f96 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/event/EventSource.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/event/EventSource.java @@ -56,7 +56,8 @@ import org.rhq.core.domain.resource.Resource; @NamedQuery(name = EventSource.QUERY_DELETE_BY_RESOURCES, query = "DELETE FROM EventSource evs WHERE evs.resource.id IN ( :resourceIds ) "), @NamedQuery(name = EventSource.QUERY_BY_EVENT_DEFINITION, query = "SELECT evs FROM EventSource evs WHERE evs.eventDefinition = :definition") }) @Table(name = EventSource.TABLE_NAME) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "idGenerator", sequenceName = EventSource.TABLE_NAME + "_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = EventSource.TABLE_NAME + + "_ID_SEQ", sequenceName = EventSource.TABLE_NAME + "_ID_SEQ") public class EventSource implements Serializable { private static final long serialVersionUID = 1L;
@@ -66,7 +67,7 @@ public class EventSource implements Serializable {
@Id @Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "idGenerator") + @GeneratedValue(strategy = GenerationType.AUTO, generator = EventSource.TABLE_NAME + "_ID_SEQ") private int id;
@JoinColumn(name = "EVENT_DEF_ID", nullable = false) diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/Availability.java b/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/Availability.java index c66d488..05217e1 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/Availability.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/Availability.java @@ -132,7 +132,7 @@ import org.rhq.core.domain.resource.Resource; + " ( SELECT res.id FROM Resource res " // + " WHERE res.agent.id = :agentId " // + " AND res.parentResource.id IS NULL )") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "Generator", sequenceName = "RHQ_AVAILABILITY_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_AVAILABILITY_ID_SEQ", sequenceName = "RHQ_AVAILABILITY_ID_SEQ") @Table(name = "RHQ_AVAILABILITY") @XmlRootElement public class Availability implements Serializable { @@ -153,7 +153,7 @@ public class Availability implements Serializable { public static final String NATIVE_QUERY_PURGE = "DELETE FROM RHQ_AVAILABILITY WHERE END_TIME < ?";
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "Generator") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_AVAILABILITY_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/MeasurementBaseline.java b/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/MeasurementBaseline.java index 4df256b..82df397 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/MeasurementBaseline.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/MeasurementBaseline.java @@ -101,7 +101,7 @@ import javax.persistence.Table; + "DELETE MeasurementBaseline bl " // + " WHERE bl.computeTime < :timestamp "), @NamedQuery(name = MeasurementBaseline.QUERY_DELETE_BY_RESOURCES, query = "DELETE MeasurementBaseline bl WHERE bl.schedule IN ( SELECT ms FROM MeasurementSchedule ms WHERE ms.resource.id IN ( :resourceIds ) )") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "MEAS_BL_GEN", sequenceName = "RHQ_MEASUREMENT_BLINE_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_MEASUREMENT_BLINE_ID_SEQ", sequenceName = "RHQ_MEASUREMENT_BLINE_ID_SEQ") @SuppressWarnings("unused") @Table(name = "RHQ_MEASUREMENT_BLINE") public class MeasurementBaseline implements Serializable { @@ -195,7 +195,7 @@ public class MeasurementBaseline implements Serializable { + " WHERE mdata.TIME_STAMP <= ? ) "; // ?4=startTime } private static final long serialVersionUID = 1L; - @GeneratedValue(strategy = GenerationType.AUTO, generator = "MEAS_BL_GEN") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_MEASUREMENT_BLINE_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/MeasurementDefinition.java b/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/MeasurementDefinition.java index 5d9253b..519f2f8 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/MeasurementDefinition.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/MeasurementDefinition.java @@ -80,7 +80,7 @@ import org.rhq.core.domain.resource.ResourceType; + " AND md.resourceType.name = :resourceTypeName" + " AND md.resourceType.plugin = :resourceTypePlugin" + " AND ((:perMinute = 1 AND md.rawNumericType IS NOT NULL) OR (:perMinute = 0 AND md.rawNumericType IS NULL))") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "id", sequenceName = "RHQ_MEASUREMENT_DEF_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_MEASUREMENT_DEF_ID_SEQ", sequenceName = "RHQ_MEASUREMENT_DEF_ID_SEQ") @Table(name = "RHQ_MEASUREMENT_DEF") @XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement @@ -118,7 +118,7 @@ public class MeasurementDefinition implements Serializable { public static final String AVAILABILITY_DISPLAY_NAME = "Availability";
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "id") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_MEASUREMENT_DEF_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/MeasurementSchedule.java b/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/MeasurementSchedule.java index b862deb..e560879 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/MeasurementSchedule.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/MeasurementSchedule.java @@ -112,7 +112,7 @@ import org.rhq.core.domain.resource.Resource; @NamedQuery(name = MeasurementSchedule.DELETE_BY_RESOURCES, query = "" // + "DELETE MeasurementSchedule ms " // + " WHERE ms.resource.id IN ( :resourceIds )") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_METRIC_SCHED_ID_SEQ", sequenceName = "RHQ_MEASUREMENT_SCHED_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_MEASUREMENT_SCHED_ID_SEQ", sequenceName = "RHQ_MEASUREMENT_SCHED_ID_SEQ") @Table(name = "RHQ_MEASUREMENT_SCHED", uniqueConstraints = { @UniqueConstraint(columnNames = { "DEFINITION", "RESOURCE_ID" }) }) public class MeasurementSchedule implements Serializable { @@ -204,7 +204,7 @@ public class MeasurementSchedule implements Serializable { + " WHERE ms.RESOURCE_ID = res.ID " // + " AND ms.DEFINITION = def.ID ) ";
- @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_METRIC_SCHED_ID_SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_MEASUREMENT_SCHED_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/ResourceAvailability.java b/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/ResourceAvailability.java index a258dbd..4a58f99 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/ResourceAvailability.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/ResourceAvailability.java @@ -81,7 +81,7 @@ import org.rhq.core.domain.resource.Resource; + " AND res.parentResource IS NULL " // we only want platforms + " AND avail.availabilityType <> 1") // get all NOT UP }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_RESOURCE_AVAIL_SEQ", sequenceName = "RHQ_RESOURCE_AVAIL_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_RESOURCE_AVAIL_ID_SEQ", sequenceName = "RHQ_RESOURCE_AVAIL_ID_SEQ") public class ResourceAvailability implements Serializable { private static final long serialVersionUID = 1L;
@@ -94,7 +94,7 @@ public class ResourceAvailability implements Serializable {
@SuppressWarnings("unused") @Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_RESOURCE_AVAIL_SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_RESOURCE_AVAIL_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/calltime/CallTimeDataKey.java b/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/calltime/CallTimeDataKey.java index f26ecbf..3ee9adc 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/calltime/CallTimeDataKey.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/calltime/CallTimeDataKey.java @@ -50,7 +50,7 @@ import org.rhq.core.domain.measurement.MeasurementSchedule; */ @Entity @NamedQueries( { @NamedQuery(name = CallTimeDataKey.QUERY_DELETE_BY_RESOURCES, query = "DELETE CallTimeDataKey ctdk WHERE ctdk.schedule IN ( SELECT ms FROM MeasurementSchedule ms WHERE ms.resource.id IN ( :resourceIds ) )") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "idGenerator", sequenceName = "RHQ_CALLTIME_DATA_KEY_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_CALLTIME_DATA_KEY_ID_SEQ", sequenceName = "RHQ_CALLTIME_DATA_KEY_ID_SEQ") @Table(name = "RHQ_CALLTIME_DATA_KEY") public class CallTimeDataKey implements Serializable { private static final long serialVersionUID = 1L; @@ -59,7 +59,7 @@ public class CallTimeDataKey implements Serializable {
public static final int DESTINATION_MAX_LENGTH = 4000;
- @GeneratedValue(strategy = GenerationType.AUTO, generator = "idGenerator") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_CALLTIME_DATA_KEY_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/calltime/CallTimeDataValue.java b/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/calltime/CallTimeDataValue.java index 96d3b54..5a2a8ad 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/calltime/CallTimeDataValue.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/measurement/calltime/CallTimeDataValue.java @@ -64,7 +64,7 @@ import org.jetbrains.annotations.Nullable; + "AND value.endTime <= :endTime " + "GROUP BY key.callDestination "), @NamedQuery(name = CallTimeDataValue.QUERY_DELETE_BY_RESOURCES, query = "DELETE CallTimeDataValue ctdv WHERE ctdv.key IN ( SELECT ctdk.id FROM CallTimeDataKey ctdk WHERE ctdk.schedule.resource.id IN ( :resourceIds ) )") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "idGenerator", sequenceName = "RHQ_CALLTIME_DATA_VALUE_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_CALLTIME_DATA_VALUE_ID_SEQ", sequenceName = "RHQ_CALLTIME_DATA_VALUE_ID_SEQ") @Table(name = "RHQ_CALLTIME_DATA_VALUE") public class CallTimeDataValue implements Serializable { private static final long serialVersionUID = 1L; @@ -72,7 +72,7 @@ public class CallTimeDataValue implements Serializable { public static final String QUERY_FIND_COMPOSITES_FOR_RESOURCE = "CallTimeDataValue.findCompositesForResource"; public static final String QUERY_DELETE_BY_RESOURCES = "CallTimeDataValue.deleteByResources";
- @GeneratedValue(strategy = GenerationType.AUTO, generator = "idGenerator") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_CALLTIME_DATA_VALUE_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/operation/OperationDefinition.java b/modules/core/domain/src/main/java/org/rhq/core/domain/operation/OperationDefinition.java index da2f29f..17ed113 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/operation/OperationDefinition.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/operation/OperationDefinition.java @@ -98,7 +98,7 @@ import org.rhq.core.domain.resource.ResourceType; + " AND rg.id = :groupId " // + " AND ( od.name = :operationName or :operationName IS NULL )" // + " ORDER BY od.displayName") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "id", sequenceName = "RHQ_OPERATION_DEF_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_OPERATION_DEF_ID_SEQ", sequenceName = "RHQ_OPERATION_DEF_ID_SEQ") @Table(name = "RHQ_OPERATION_DEF") public class OperationDefinition implements Serializable { public static final String QUERY_FIND_BY_TYPE_AND_NAME = "OperationDefinition.findByTypeAndName"; @@ -122,7 +122,7 @@ public class OperationDefinition implements Serializable { public static final String TIMEOUT_PARAM_NAME = "rhq.timeout";
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "id") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_OPERATION_DEF_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/operation/OperationHistory.java b/modules/core/domain/src/main/java/org/rhq/core/domain/operation/OperationHistory.java index ff4d4c6..f81ec9a 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/operation/OperationHistory.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/operation/OperationHistory.java @@ -124,7 +124,7 @@ import org.rhq.core.domain.configuration.Configuration; ) })
-@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_OPERATION_HISTORY_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_OPERATION_HISTORY_ID_SEQ", sequenceName = "RHQ_OPERATION_HISTORY_ID_SEQ") @Table(name = "RHQ_OPERATION_HISTORY") public abstract class OperationHistory implements Serializable { public static final String QUERY_FIND_BY_JOB_ID = "OperationHistory.findByJobId"; @@ -142,7 +142,7 @@ public abstract class OperationHistory implements Serializable { private static final long serialVersionUID = 1L;
@Column(name = "ID") - @GeneratedValue(generator = "SEQ", strategy = GenerationType.AUTO) + @GeneratedValue(generator = "RHQ_OPERATION_HISTORY_ID_SEQ", strategy = GenerationType.AUTO) @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/operation/OperationScheduleEntity.java b/modules/core/domain/src/main/java/org/rhq/core/domain/operation/OperationScheduleEntity.java index eab6e43..d593622 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/operation/OperationScheduleEntity.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/operation/OperationScheduleEntity.java @@ -114,7 +114,7 @@ import javax.persistence.Table; + " JOIN r.subjects s " // + " WHERE go.nextFireTime IS NOT NULL " // + " AND s = :subject ") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "id", sequenceName = "RHQ_OPERATION_SCHEDULE_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_OPERATION_SCHEDULE_ID_SEQ", sequenceName = "RHQ_OPERATION_SCHEDULE_ID_SEQ") @Table(name = "RHQ_OPERATION_SCHEDULE") public abstract class OperationScheduleEntity implements Serializable {
@@ -127,7 +127,7 @@ public abstract class OperationScheduleEntity implements Serializable { private static final long serialVersionUID = 1L;
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "id") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_OPERATION_SCHEDULE_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/plugin/AbstractPlugin.java b/modules/core/domain/src/main/java/org/rhq/core/domain/plugin/AbstractPlugin.java index 642e064..7f3a138 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/plugin/AbstractPlugin.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/plugin/AbstractPlugin.java @@ -48,7 +48,7 @@ import javax.persistence.Transient; @DiscriminatorColumn(name = "DEPLOYMENT") @Inheritance(strategy = InheritanceType.SINGLE_TABLE) @Entity -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_PLUGIN_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_PLUGIN_ID_SEQ", sequenceName = "RHQ_PLUGIN_ID_SEQ") @Table(name = Plugin.TABLE_NAME) public class AbstractPlugin implements Serializable { private static final long serialVersionUID = 1L; @@ -56,7 +56,7 @@ public class AbstractPlugin implements Serializable { public static final String TABLE_NAME = "RHQ_PLUGIN";
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_PLUGIN_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Agent.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Agent.java index 5948a7e..788e189 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Agent.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Agent.java @@ -139,7 +139,7 @@ import org.rhq.core.domain.cloud.Server; + " SET a.status = -1 " // negative numbers so that bitmask strategy does not conflict with this one + " WHERE a.status = 0 ") // }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "id", sequenceName = "RHQ_AGENT_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_AGENT_ID_SEQ", sequenceName = "RHQ_AGENT_ID_SEQ") @Table(name = "RHQ_AGENT") public class Agent implements Serializable { public static final long serialVersionUID = 1L; @@ -177,7 +177,7 @@ public class Agent implements Serializable { public static final String SECURITY_TOKEN_RESET = "@#$reset$#@";
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "id") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_AGENT_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/CreateResourceHistory.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/CreateResourceHistory.java index c2a369a..e0a345d 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/CreateResourceHistory.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/CreateResourceHistory.java @@ -63,7 +63,7 @@ import org.rhq.core.domain.content.InstalledPackage; + " AND ( crh.mtime < :endTime OR :endTime IS NULL ) "), @NamedQuery(name = CreateResourceHistory.QUERY_FIND_BY_ID, query = "SELECT crh FROM CreateResourceHistory AS crh WHERE crh.id = :id"), @NamedQuery(name = CreateResourceHistory.QUERY_DELETE_BY_RESOURCES, query = "DELETE FROM CreateResourceHistory crh WHERE crh.parentResource.id IN ( :resourceIds ) )") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_CREATE_RES_HIST_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_CREATE_RES_HIST_ID_SEQ", sequenceName = "RHQ_CREATE_RES_HIST_ID_SEQ") @Table(name = "RHQ_CREATE_RES_HIST") public class CreateResourceHistory implements Serializable {
@@ -77,7 +77,7 @@ public class CreateResourceHistory implements Serializable {
// Attributes --------------------------------------------
- @GeneratedValue(generator = "SEQ", strategy = GenerationType.AUTO) + @GeneratedValue(generator = "RHQ_CREATE_RES_HIST_ID_SEQ", strategy = GenerationType.AUTO) @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/DeleteResourceHistory.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/DeleteResourceHistory.java index 4abef95..43b700f 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/DeleteResourceHistory.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/DeleteResourceHistory.java @@ -22,8 +22,6 @@ */ package org.rhq.core.domain.resource;
-import java.io.ByteArrayOutputStream; -import java.io.PrintStream; import java.io.Serializable; import java.util.Date;
@@ -58,7 +56,7 @@ import javax.persistence.Table; + " AND ( drh.ctime > :startTime OR :startTime IS NULL ) " // + " AND ( drh.mtime < :endTime OR :endTime IS NULL ) "), @NamedQuery(name = DeleteResourceHistory.QUERY_DELETE_BY_RESOURCES, query = "DELETE FROM DeleteResourceHistory drh WHERE drh.resource.id IN ( :resourceIds ) )") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_DELETE_RES_HIST_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_DELETE_RES_HIST_ID_SEQ", sequenceName = "RHQ_DELETE_RES_HIST_ID_SEQ") @Table(name = "RHQ_DELETE_RES_HIST") public class DeleteResourceHistory implements Serializable {
@@ -72,7 +70,7 @@ public class DeleteResourceHistory implements Serializable {
// Attributes --------------------------------------------
- @GeneratedValue(generator = "SEQ", strategy = GenerationType.AUTO) + @GeneratedValue(generator = "RHQ_DELETE_RES_HIST_ID_SEQ", strategy = GenerationType.AUTO) @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ProcessScan.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ProcessScan.java index c4b9c56..d9aaaea 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ProcessScan.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ProcessScan.java @@ -38,13 +38,13 @@ import javax.persistence.Table; * @author John Mazzitelli */ @Entity -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_PROCESS_SCAN_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_PROCESS_SCAN_ID_SEQ", sequenceName = "RHQ_PROCESS_SCAN_ID_SEQ") @Table(name = "RHQ_PROCESS_SCAN") public class ProcessScan implements Serializable { private static final long serialVersionUID = 1L;
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_PROCESS_SCAN_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ProductVersion.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ProductVersion.java index 553f11f..629499e 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ProductVersion.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ProductVersion.java @@ -52,7 +52,7 @@ import org.rhq.core.domain.content.ProductVersionPackageVersion; */ @Entity @NamedQueries( { @NamedQuery(name = ProductVersion.QUERY_FIND_BY_RESOURCE_TYPE_AND_VERSION, query = "SELECT pv FROM ProductVersion AS pv WHERE pv.resourceType = :resourceType AND pv.version = :version") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_PRD_VER_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_PRD_VER_ID_SEQ", sequenceName = "RHQ_PRD_VER_ID_SEQ") @Table(name = "RHQ_PRD_VER") public class ProductVersion implements Serializable { // Constants -------------------------------------------- @@ -64,7 +64,7 @@ public class ProductVersion implements Serializable { // Attributes --------------------------------------------
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_PRD_VER_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java index be29fd6..c54d987 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/Resource.java @@ -765,7 +765,7 @@ import org.rhq.core.domain.util.Summary; + " 0 < ( SELECT COUNT(defs) FROM r.driftDefinitions defs WHERE defs.complianceStatus <> 0) " + "GROUP BY rt.name, rt.plugin, rt.category, rt.id, r.version " + "ORDER BY rt.category, rt.plugin, rt.name, r.version ") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_RESOURCE_SEQ", sequenceName = "RHQ_RESOURCE_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_RESOURCE_ID_SEQ", sequenceName = "RHQ_RESOURCE_ID_SEQ") @Table(name = Resource.TABLE_NAME) @XmlAccessorType(XmlAccessType.FIELD) @XmlRootElement @@ -915,7 +915,7 @@ public class Resource implements Comparable<Resource>, Serializable { public static final int ROOT_ID = -1;
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_RESOURCE_SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_RESOURCE_ID_SEQ") @Id @Summary(index = 0) private int id; diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceError.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceError.java index b0e22ed..b557ac8 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceError.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceError.java @@ -56,7 +56,7 @@ import org.jetbrains.annotations.Nullable; @NamedQuery(name = ResourceError.QUERY_DELETE_BY_RESOURCES, query = "DELETE From ResourceError re WHERE re.resource.id IN ( :resourceIds )"), @NamedQuery(name = ResourceError.QUERY_FIND_BY_RESOURCE_ID, query = "SELECT re FROM ResourceError re WHERE re.resource.id = :resourceId"), @NamedQuery(name = ResourceError.QUERY_FIND_BY_RESOURCE_ID_AND_ERROR_TYPE, query = "SELECT re FROM ResourceError re WHERE re.resource.id = :resourceId AND re.errorType = :errorType") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_RESOURCE_ERROR_SEQ", sequenceName = "RHQ_RESOURCE_ERROR_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_RESOURCE_ERROR_ID_SEQ", sequenceName = "RHQ_RESOURCE_ERROR_ID_SEQ") @Table(name = "RHQ_RESOURCE_ERROR") @XmlAccessorType(XmlAccessType.PROPERTY) public class ResourceError implements Serializable { @@ -69,7 +69,7 @@ public class ResourceError implements Serializable { private static final int MAX_SUMMARY_LENGTH = 1000;
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_RESOURCE_ERROR_SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_RESOURCE_ERROR_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceSubCategory.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceSubCategory.java index e2bd3e6..10b0247 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceSubCategory.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/ResourceSubCategory.java @@ -53,7 +53,7 @@ import org.jetbrains.annotations.NotNull; * Class representing a sub category, where a sub category is meant to group similar Resource types together. */ @Entity -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_RESOURCE_SUBCAT_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_RESOURCE_SUBCAT_ID_SEQ", sequenceName = "RHQ_RESOURCE_SUBCAT_ID_SEQ") @Table(name = "RHQ_RESOURCE_SUBCAT") @NamedQueries( { @NamedQuery(name = ResourceSubCategory.QUERY_FIND_BY_NAME_AND_PLUGIN, query = "SELECT rsc FROM ResourceSubCategory AS rsc WHERE rsc.name = :name AND rsc.resourceType.plugin = :plugin") }) public class ResourceSubCategory implements Comparable<ResourceSubCategory>, Serializable { @@ -62,7 +62,7 @@ public class ResourceSubCategory implements Comparable<ResourceSubCategory>, Ser public static final String QUERY_FIND_BY_NAME_AND_PLUGIN = "ResourceSubCategory.findByNameAndPlugin";
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_RESOURCE_SUBCAT_ID_SEQ") @Id private int id;
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 4833613..3e8f6f7 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 @@ -80,7 +80,7 @@ import org.rhq.core.domain.util.Summary; */ @Entity @Table(name = ResourceType.TABLE_NAME) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "SEQ", sequenceName = "RHQ_RESOURCE_TYPE_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_RESOURCE_TYPE_ID_SEQ", sequenceName = "RHQ_RESOURCE_TYPE_ID_SEQ") @NamedQueries( { @NamedQuery(name = ResourceType.QUERY_GET_BUNDLE_CONFIG_BY_GROUP_ID, query = "SELECT rg.resourceType.bundleConfiguration FROM ResourceGroup rg WHERE rg.id = :groupId"), @NamedQuery(name = ResourceType.QUERY_FIND_BY_PLUGIN, query = "SELECT rt FROM ResourceType AS rt " @@ -296,7 +296,7 @@ public class ResourceType implements Serializable, Comparable<ResourceType> {
@Id @Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_RESOURCE_TYPE_ID_SEQ") @Summary(index = 0) private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/GroupDefinition.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/GroupDefinition.java index 4f3f510..e48c0e7 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/GroupDefinition.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/GroupDefinition.java @@ -84,7 +84,7 @@ import org.rhq.core.domain.util.StringUtils; + "SELECT gd " // + " FROM GroupDefinition AS gd " // + " WHERE gd.recalculationInterval != 0 ") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "id", sequenceName = "RHQ_GROUP_DEF_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_GROUP_DEF_ID_SEQ", sequenceName = "RHQ_GROUP_DEF_ID_SEQ") @Table(name = "RHQ_GROUP_DEF") public class GroupDefinition implements Serializable { private static final long serialVersionUID = 1L; @@ -99,7 +99,7 @@ public class GroupDefinition implements Serializable { public static final String QUERY_FIND_ALL_RECALCULATING = "GroupDefinition.findAllRecalculating_admin";
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "id") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_GROUP_DEF_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/LdapGroup.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/LdapGroup.java index 7ba5a6b..4da7625 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/LdapGroup.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/LdapGroup.java @@ -47,7 +47,7 @@ import org.rhq.core.domain.authz.Role; @NamedQuery(name = LdapGroup.QUERY_FIND_ALL, query = "SELECT g FROM LdapGroup AS g"), // @NamedQuery(name = LdapGroup.FIND_BY_ROLES_GROUP_NAMES, query = "SELECT distinct l.role FROM LdapGroup l WHERE l.name in (:names)") }) @Table(name = "RHQ_ROLE_LDAP_GROUP") -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "id", sequenceName = "RHQ_ROLE_LDAP_GROUP_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_ROLE_LDAP_GROUP_ID_SEQ", sequenceName = "RHQ_ROLE_LDAP_GROUP_ID_SEQ") @XmlAccessorType(XmlAccessType.FIELD) public class LdapGroup implements Serializable {
@@ -59,7 +59,7 @@ public class LdapGroup implements Serializable {
@Id @Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "id") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_ROLE_LDAP_GROUP_ID_SEQ") private int id;
@ManyToOne diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/ResourceGroup.java b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/ResourceGroup.java index 954568d..eda9d9f 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/ResourceGroup.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/resource/group/ResourceGroup.java @@ -199,7 +199,7 @@ import org.rhq.core.domain.tagging.Tag; + " JOIN rg.explicitResources explicitRes " // + " WHERE rg.id = :groupId ) " // + " AND res.inventoryStatus = 'COMMITTED' ") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "id", sequenceName = "RHQ_RESOURCE_GROUP_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_RESOURCE_GROUP_ID_SEQ", sequenceName = "RHQ_RESOURCE_GROUP_ID_SEQ") @Table(name = "RHQ_RESOURCE_GROUP") @XmlAccessorType(XmlAccessType.FIELD) public class ResourceGroup extends Group { @@ -442,7 +442,7 @@ public class ResourceGroup extends Group { + " g6parent.ID = alreadyMember.RESOURCE_ID ) ) ";
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "id") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_RESOURCE_GROUP_ID_SEQ") @Id private int id;
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/search/SavedSearch.java b/modules/core/domain/src/main/java/org/rhq/core/domain/search/SavedSearch.java index 0988d19..a3dff26 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/search/SavedSearch.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/search/SavedSearch.java @@ -58,7 +58,7 @@ import org.rhq.core.domain.auth.Subject; * @author Joseph Marques */ @Entity -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "id", sequenceName = "RHQ_SAVED_SEARCH_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_SAVED_SEARCH_ID_SEQ", sequenceName = "RHQ_SAVED_SEARCH_ID_SEQ") @Table(name = "RHQ_SAVED_SEARCH") public class SavedSearch implements Serializable {
@@ -66,7 +66,7 @@ public class SavedSearch implements Serializable {
@Id @Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "id") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_SAVED_SEARCH_ID_SEQ") private Integer id;
@Column(name = "CONTEXT", nullable = false) diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/tagging/Tag.java b/modules/core/domain/src/main/java/org/rhq/core/domain/tagging/Tag.java index 2818f77..d2ca730 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/tagging/Tag.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/tagging/Tag.java @@ -62,7 +62,7 @@ import org.rhq.core.domain.resource.group.ResourceGroup; "GROUP BY t.id, t.namespace, t.semantic, t.name\n" + "ORDER BY (count(r) + count(g) + count(b) + count(bv) + count(bd)) desc") }) -@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_TAGGING_SEQ", sequenceName = "RHQ_TAGGING_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "RHQ_TAGGING_ID_SEQ", sequenceName = "RHQ_TAGGING_ID_SEQ") @Table(name = "RHQ_TAGGING") @XmlAccessorType(XmlAccessType.FIELD) public class Tag implements Serializable { @@ -72,7 +72,7 @@ public class Tag implements Serializable { public static final String QUERY_TAG_COMPOSITE_REPORT = "Tag.compositeReport";
@Column(name = "ID", nullable = false) - @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_TAGGING_SEQ") + @GeneratedValue(strategy = GenerationType.AUTO, generator = "RHQ_TAGGING_ID_SEQ") @Id private int id;
commit dece2af450b52df1600f582ebaffba06e0d9b1e2 Author: Jay Shaughnessy jshaughn@redhat.com Date: Wed Mar 13 16:21:58 2013 -0400
The SequenceGenerator allocation size must match the increment size of the underlying sequence.
diff --git a/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/Server.java b/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/Server.java index a114843..c1adcd7 100644 --- a/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/Server.java +++ b/modules/core/domain/src/main/java/org/rhq/core/domain/cloud/Server.java @@ -90,7 +90,7 @@ import org.rhq.core.domain.resource.Agent; + " UPDATE Server s " // + " SET s.status = -1 " // negative numbers so that bitmask strat does not conflict with this one + " WHERE s.status = 0 ") }) -@SequenceGenerator(name = "id", sequenceName = "RHQ_SERVER_ID_SEQ") +@SequenceGenerator(allocationSize = org.rhq.core.domain.util.Constants.ALLOCATION_SIZE, name = "id", sequenceName = "RHQ_SERVER_ID_SEQ") @Table(name = "RHQ_SERVER") public class Server implements Serializable {
rhq-commits@lists.fedorahosted.org