diff options
| author | Stefan Suhren <suhren.stefan@fh-swf.de> | 2015-11-23 15:40:44 +0100 |
|---|---|---|
| committer | Stefan Suhren <suhren.stefan@fh-swf.de> | 2015-11-23 15:57:23 +0100 |
| commit | cd9d62986882b298948dff96f8bc4d18a086f90d (patch) | |
| tree | 11c95261c2ed6e2e5ea735ba9e76fd33f403626a /src/jpa/Category.java | |
| parent | ea3b3f9bf0d803bd98d997b3dd1a6ac845736069 (diff) | |
| download | JCatalog-cd9d62986882b298948dff96f8bc4d18a086f90d.tar.gz JCatalog-cd9d62986882b298948dff96f8bc4d18a086f90d.zip | |
Format files and organize imports
Diffstat (limited to 'src/jpa/Category.java')
| -rw-r--r-- | src/jpa/Category.java | 90 |
1 files changed, 52 insertions, 38 deletions
diff --git a/src/jpa/Category.java b/src/jpa/Category.java index 195b6e8..bbd832d 100644 --- a/src/jpa/Category.java +++ b/src/jpa/Category.java @@ -1,64 +1,78 @@ package jpa; import java.io.Serializable; -import javax.persistence.*; import java.util.Set; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.ManyToMany; +import javax.persistence.NamedQuery; +import javax.persistence.Table; /** * The persistent class for the category database table. * */ @Entity -@Table(name="category") -@NamedQuery(name="Category.findAll", query="SELECT c FROM Category c") -public class Category implements Serializable { - private static final long serialVersionUID = 1L; +@Table(name = "category") +@NamedQuery(name = "Category.findAll", query = "SELECT c FROM Category c") +public class Category implements Serializable +{ + private static final long serialVersionUID = 1L; - @Id - private int id; + @Id + private int id; - private String description; + private String description; - private String name; + private String name; - //bi-directional many-to-many association to Product - @ManyToMany(mappedBy="categories") - private Set<Product> products; + // bi-directional many-to-many association to Product + @ManyToMany(mappedBy = "categories") + private Set<Product> products; - public Category() { - } + public Category() + { + } - public int getId() { - return this.id; - } + public int getId() + { + return this.id; + } - public void setId(int id) { - this.id = id; - } + public void setId(int id) + { + this.id = id; + } - public String getDescription() { - return this.description; - } + public String getDescription() + { + return this.description; + } - public void setDescription(String description) { - this.description = description; - } + public void setDescription(String description) + { + this.description = description; + } - public String getName() { - return this.name; - } + public String getName() + { + return this.name; + } - public void setName(String name) { - this.name = name; - } + public void setName(String name) + { + this.name = name; + } - public Set<Product> getProducts() { - return this.products; - } + public Set<Product> getProducts() + { + return this.products; + } - public void setProducts(Set<Product> products) { - this.products = products; - } + public void setProducts(Set<Product> products) + { + this.products = products; + } }
\ No newline at end of file |
