diff options
author | Maria Odea B. Ching <oching@apache.org> | 2008-04-30 03:29:34 +0000 |
---|---|---|
committer | Maria Odea B. Ching <oching@apache.org> | 2008-04-30 03:29:34 +0000 |
commit | ce8c8a06a2498c5058ee4ac86025aa9060ebcbe2 (patch) | |
tree | 92a9add3aeb4aec42406c9c13deb41101d204be2 | |
parent | a8bc40dbd4e39841dca02c43b8634317a0cb6844 (diff) | |
download | archiva-ce8c8a06a2498c5058ee4ac86025aa9060ebcbe2.tar.gz archiva-ce8c8a06a2498c5058ee4ac86025aa9060ebcbe2.zip |
[MRM-773]
fixed where condition for querying new versions of a specific artifact
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@652241 13f79535-47bb-0310-9956-ffa450edef68
2 files changed, 11 insertions, 11 deletions
diff --git a/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/ArtifactVersionsConstraint.java b/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/ArtifactVersionsConstraint.java index e8beae0c9..fc976e356 100644 --- a/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/ArtifactVersionsConstraint.java +++ b/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/ArtifactVersionsConstraint.java @@ -39,12 +39,16 @@ public class ArtifactVersionsConstraint { if( repoId != null ) { - whereClause = "repositoryId == repoId && "; + whereClause = "repositoryId.equals(selectedRepoId) && groupId.equals(selectedGroupId) && artifactId.equals(selectedArtifactId)"; + declParams = new String[] { "String selectedRepoId", "String selectedGroupId", "String selectedArtifactId" }; + params = new Object[] { repoId, groupId, artifactId }; + } + else + { + whereClause = "groupId.equals(selectedGroupId) && artifactId.equals(selectedArtifactId)"; + declParams = new String[] { "String selectedGroupId", "String selectedArtifactId" }; + params = new Object[] { groupId, artifactId }; } - - whereClause = whereClause + "groupId == groupId && artifactId == artifactId"; - declParams = new String[] { "String repoId", "String groupId", "String artifactId" }; - params = new Object[] { repoId, groupId, artifactId }; } public ArtifactVersionsConstraint( String repoId, String groupId, String artifactId, String sortColumn ) diff --git a/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/processor/NewVersionsOfArtifactRssFeedProcessor.java b/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/processor/NewVersionsOfArtifactRssFeedProcessor.java index 058838aed..b9261efa1 100644 --- a/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/processor/NewVersionsOfArtifactRssFeedProcessor.java +++ b/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/processor/NewVersionsOfArtifactRssFeedProcessor.java @@ -56,7 +56,7 @@ public class NewVersionsOfArtifactRssFeedProcessor */ private RssFeedGenerator generator; - private Logger log = LoggerFactory.getLogger( NewArtifactsRssFeedProcessor.class ); + private Logger log = LoggerFactory.getLogger( NewVersionsOfArtifactRssFeedProcessor.class ); /** * @plexus.requirement role-hint="jdo" @@ -83,19 +83,15 @@ public class NewVersionsOfArtifactRssFeedProcessor private SyndFeed processNewVersionsOfArtifact( String repoId, String groupId, String artifactId ) { try - { + { Constraint artifactVersions = new ArtifactVersionsConstraint( repoId, groupId, artifactId, "whenGathered" ); List<ArchivaArtifact> artifacts = artifactDAO.queryArtifacts( artifactVersions ); - - log.info( "Queried artifacts size :: " + artifacts.size() ); List<RssFeedEntry> entries = processData( artifacts, false ); - String key = groupId + ":" + artifactId; return generator.generateFeed( getTitle() + "\'" + key + "\'", "New versions of artifact " + "\'" + key + "\' found in repository " + "\'" + repoId + "\'" + " during repository scan.", entries, "rss_feeds?groupId=" + groupId + "&artifactId=" + artifactId ); - } catch ( ObjectNotFoundException oe ) { |