From 188c3afc3b8396fba1d5d7767b5ec8f21b6d9732 Mon Sep 17 00:00:00 2001 From: Stefan Suhren Date: Mon, 14 Dec 2015 01:09:45 +0100 Subject: Change Set to Collection for better testing --- src/jpa/Category.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/jpa/Category.java') 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 products; + private Collection products; public Category() { @@ -67,12 +68,12 @@ public class Category implements Serializable this.name = name; } - public Set getProducts() + public Collection getProducts() { return this.products; } - public void setProducts(Set products) + public void setProducts(Collection products) { this.products = products; } -- cgit v1.2.3-70-g09d2