1 package org.apache.archiva.metadata.repository.cassandra.model;
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
22 import com.netflix.astyanax.entitystore.Serializer;
24 import javax.persistence.Column;
25 import javax.persistence.Entity;
26 import javax.persistence.Id;
27 import javax.persistence.Table;
28 import java.io.Serializable;
29 import java.util.ArrayList;
30 import java.util.List;
34 * @author Olivier Lamy
37 @Table(name = "repository", schema = "ArchivaKeySpace@archiva")
38 public class Repository
39 implements Serializable
43 @Column( name = "id" )
44 @Serializer( HugeStringSerializer.class )
47 @Column(name = "name")
48 @Serializer( HugeStringSerializer.class )
51 //private transient List<Namespace> namespaces = new ArrayList<Namespace>();
58 public Repository( String id )
69 public void setId( String id )
74 public String getName()
79 public void setName( String name )
85 public List<Namespace> getNamespaces()
87 if ( this.namespaces == null )
89 this.namespaces = new ArrayList<Namespace>();
94 public void setNamespaces( List<Namespace> namespaces )
96 this.namespaces = namespaces;
101 public boolean equals( Object o )
107 if ( o == null || getClass() != o.getClass() )
112 Repository that = (Repository) o;
114 if ( !id.equals( that.id ) )
123 public int hashCode()
125 return id.hashCode();
130 public String toString()
132 final StringBuilder sb = new StringBuilder( "Repository{" );
133 sb.append( "id='" ).append( id ).append( '\'' );
134 sb.append( ", name='" ).append( name ).append( '\'' );
135 //sb.append( ", namespaces=" ).append( namespaces );
137 return sb.toString();