diff options
author | Devan Goodwin <dgoodwin@redhat.com> | 2009-11-24 15:48:56 -0400 |
---|---|---|
committer | Devan Goodwin <dgoodwin@redhat.com> | 2009-11-24 15:48:56 -0400 |
commit | d2ab883a822489ccf78351f34a4d798258816db1 (patch) | |
tree | b12a1b108ef7f830c173284d5979029317af01c4 | |
parent | 9c58ed07bccf729ffe575cbfb3af3643365abc39 (diff) | |
download | candlepin-d2ab883a822489ccf78351f34a4d798258816db1.tar.gz candlepin-d2ab883a822489ccf78351f34a4d798258816db1.tar.xz candlepin-d2ab883a822489ccf78351f34a4d798258816db1.zip |
Move Product annotations onto fields instead of getters.
Seems like a more consistent way to do this.
-rw-r--r-- | proxy/code/src/org/fedoraproject/candlepin/model/Owner.java | 4 | ||||
-rw-r--r-- | proxy/code/src/org/fedoraproject/candlepin/model/Product.java | 30 |
2 files changed, 20 insertions, 14 deletions
diff --git a/proxy/code/src/org/fedoraproject/candlepin/model/Owner.java b/proxy/code/src/org/fedoraproject/candlepin/model/Owner.java index f73d87f..eace64c 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/model/Owner.java +++ b/proxy/code/src/org/fedoraproject/candlepin/model/Owner.java @@ -17,6 +17,7 @@ package org.fedoraproject.candlepin.model; import java.util.LinkedList; import java.util.List; +import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; @@ -43,7 +44,10 @@ public class Owner { @GeneratedValue(strategy=GenerationType.AUTO) private Long id; + @Column(nullable=false) private String name; + + // TODO: Remove these transients once the appropriate objects are mapped: @Transient private List<Consumer> consumers; diff --git a/proxy/code/src/org/fedoraproject/candlepin/model/Product.java b/proxy/code/src/org/fedoraproject/candlepin/model/Product.java index 1ff6e1d..9172c70 100644 --- a/proxy/code/src/org/fedoraproject/candlepin/model/Product.java +++ b/proxy/code/src/org/fedoraproject/candlepin/model/Product.java @@ -40,27 +40,25 @@ import javax.xml.bind.annotation.XmlRootElement; @Table(name="cp_product") public class Product { + @Id + @GeneratedValue(strategy=GenerationType.AUTO) private Long id; // TODO: Drop one of these? + @Column(nullable=false) private String label; + + @Column(nullable=false) private String name; // TODO: Drop this? private String uuid; - - // TODO: + + // TODO + @Transient private List<Product> childProducts; /** - * Create product with UUID - * @param uuid unique id for the product - */ - public Product(String uuid) { - setUuid(uuid); - } - - /** * Constructor * * Use this variant when creating a new object to persist. @@ -81,10 +79,16 @@ public class Product { } /** + * Create product with UUID + * @param uuid unique id for the product + */ + public Product(String uuid) { + setUuid(uuid); + } + + /** * @return the id */ - @Id - @GeneratedValue(strategy=GenerationType.AUTO) public Long getId() { return id; } @@ -99,7 +103,6 @@ public class Product { /** * @return the childProducts */ - @Transient public List<Product> getChildProducts() { return childProducts; } @@ -135,7 +138,6 @@ public class Product { /** * @return Returns the label. */ - @Column(nullable=false) public String getLabel() { return label; } |