fix collection for ProjectVersionMetadataModel
authorOlivier Lamy <olamy@apache.org>
Mon, 10 Jun 2013 07:43:39 +0000 (07:43 +0000)
committerOlivier Lamy <olamy@apache.org>
Mon, 10 Jun 2013 07:43:39 +0000 (07:43 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/sandbox/trunk@1491359 13f79535-47bb-0310-9956-ffa450edef68

metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/CassandraMetadataRepository.java
metadata-store-cassandra/src/main/java/org/apache/archiva/metadata/repository/cassandra/model/ProjectVersionMetadataModel.java

index a889a96..33d7378 100644 (file)
@@ -829,8 +829,9 @@ public class CassandraMetadataRepository
             projectVersionMetadataModel.setProjectId( projectId );
             projectVersionMetadataModel.setId( projectVersion );
             projectVersionMetadataModel.setNamespace( namespace );
+
             projectVersionMetadataModelEntityManager.put( projectVersionMetadataModel );
-            // FIXME collections  ???
+
         }
 
         // now facets
@@ -967,7 +968,11 @@ public class CassandraMetadataRepository
         projectVersionMetadataModel.setIssueManagement( versionMetadata.getIssueManagement() );
         projectVersionMetadataModel.setOrganization( versionMetadata.getOrganization() );
         projectVersionMetadataModel.setScm( versionMetadata.getScm() );
-        // FIXME collections !!
+
+        projectVersionMetadataModel.setMailingLists( versionMetadata.getMailingLists() );
+        projectVersionMetadataModel.setDependencies( versionMetadata.getDependencies() );
+        projectVersionMetadataModel.setLicenses( versionMetadata.getLicenses() );
+
 
         try
         {
index dcdf1d1..7afa945 100644 (file)
@@ -20,13 +20,18 @@ package org.apache.archiva.metadata.repository.cassandra.model;
  */
 
 import org.apache.archiva.metadata.model.CiManagement;
+import org.apache.archiva.metadata.model.Dependency;
 import org.apache.archiva.metadata.model.IssueManagement;
+import org.apache.archiva.metadata.model.License;
+import org.apache.archiva.metadata.model.MailingList;
 import org.apache.archiva.metadata.model.Organization;
 import org.apache.archiva.metadata.model.Scm;
 
 import javax.persistence.Column;
 import javax.persistence.Entity;
 import javax.persistence.Id;
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * @author Olivier Lamy
@@ -72,11 +77,14 @@ public class ProjectVersionMetadataModel
     private CiManagement ciManagement;
 
     // FIXME store those values in a separate table
-    //private List<License> licenses = new ArrayList<License>();
+    @Column(name = "licenses")
+    private List<License> licenses = new ArrayList<License>();
 
-    //private List<MailingList> mailingLists = new ArrayList<MailingList>();
+    @Column(name = "mailingLists")
+    private List<MailingList> mailingLists = new ArrayList<MailingList>();
 
-    //private List<Dependency> dependencies = new ArrayList<Dependency>();
+    @Column(name = "dependencies")
+    private List<Dependency> dependencies = new ArrayList<Dependency>();
 
     @Column(name = "incomplete")
     private boolean incomplete;
@@ -202,6 +210,36 @@ public class ProjectVersionMetadataModel
         this.namespace = namespace;
     }
 
+    public List<License> getLicenses()
+    {
+        return licenses;
+    }
+
+    public void setLicenses( List<License> licenses )
+    {
+        this.licenses = licenses;
+    }
+
+    public List<MailingList> getMailingLists()
+    {
+        return mailingLists;
+    }
+
+    public void setMailingLists( List<MailingList> mailingLists )
+    {
+        this.mailingLists = mailingLists;
+    }
+
+    public List<Dependency> getDependencies()
+    {
+        return dependencies;
+    }
+
+    public void setDependencies( List<Dependency> dependencies )
+    {
+        this.dependencies = dependencies;
+    }
+
     @Override
     public String toString()
     {