summaryrefslogtreecommitdiffstats
path: root/src/jpa/Category.java
diff options
context:
space:
mode:
authorStefan Suhren <suhren.stefan@fh-swf.de>2015-12-14 01:09:45 +0100
committerStefan Suhren <suhren.stefan@fh-swf.de>2015-12-14 01:09:45 +0100
commit188c3afc3b8396fba1d5d7767b5ec8f21b6d9732 (patch)
tree3126791a636dba733875ef423bbed4e217293308 /src/jpa/Category.java
parent872c4e65f6d740d60acf378838f843e8586255c9 (diff)
downloadJCatalog-188c3afc3b8396fba1d5d7767b5ec8f21b6d9732.tar.gz
JCatalog-188c3afc3b8396fba1d5d7767b5ec8f21b6d9732.zip
Change Set to Collection for better testing
Diffstat (limited to 'src/jpa/Category.java')
-rw-r--r--src/jpa/Category.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/jpa/Category.java b/src/jpa/Category.java
index 8b30db9..431635c 100644
--- a/src/jpa/Category.java
+++ b/src/jpa/Category.java
@@ -1,7 +1,7 @@
package jpa;
import java.io.Serializable;
-import java.util.Set;
+import java.util.Collection;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
@@ -22,7 +22,8 @@ public class Category implements Serializable
{
private static final long serialVersionUID = 1L;
- @Id @GeneratedValue(strategy=GenerationType.IDENTITY)
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
private int id;
private String description;
@@ -31,7 +32,7 @@ public class Category implements Serializable
// bi-directional many-to-many association to Product
@ManyToMany(mappedBy = "categories")
- private Set<Product> products;
+ private Collection<Product> products;
public Category()
{
@@ -67,12 +68,12 @@ public class Category implements Serializable
this.name = name;
}
- public Set<Product> getProducts()
+ public Collection<Product> getProducts()
{
return this.products;
}
- public void setProducts(Set<Product> products)
+ public void setProducts(Collection<Product> products)
{
this.products = products;
}