Commit 8fab60f7 by Tuomas Riihimäki

Ohops.. Productissa price pitäisi olla varmaan BigDecimal

1 parent 1aeabaac
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
<property name="eclipselink.ddl-generation" value="drop-and-create-tables"/> <property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>
<property name="eclipselink.ddl-generation.output-mode" value="both"/> <property name="eclipselink.ddl-generation.output-mode" value="both"/>
<property name="eclipselink.cache.type.default" value="NONE"/> <property name="eclipselink.cache.type.default" value="NONE"/>
<property name="eclipselink.logging.level" value="ALL"/>
</properties> </properties>
</persistence-unit> </persistence-unit>
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
*/ */
package fi.insomnia.bortal.model; package fi.insomnia.bortal.model;
import java.math.BigDecimal;
import java.math.BigInteger; import java.math.BigInteger;
import java.util.List; import java.util.List;
...@@ -44,8 +45,8 @@ public class Product implements EventChildInterface { ...@@ -44,8 +45,8 @@ public class Product implements EventChildInterface {
@Column(name = "product_name") @Column(name = "product_name")
private String name; private String name;
@Column(name = "price", nullable = false) @Column(name = "price", nullable = false,precision = 24, scale = 4)
private BigInteger price; private BigDecimal price;
@Column(name = "sort", nullable = false) @Column(name = "sort", nullable = false)
private int sort; private int sort;
...@@ -84,7 +85,7 @@ public class Product implements EventChildInterface { ...@@ -84,7 +85,7 @@ public class Product implements EventChildInterface {
this.id = new EventPk(event); this.id = new EventPk(event);
} }
public Product(Event event, BigInteger price, int sort) { public Product(Event event, BigDecimal price, int sort) {
this(event); this(event);
this.price = price; this.price = price;
this.sort = sort; this.sort = sort;
...@@ -98,11 +99,11 @@ public class Product implements EventChildInterface { ...@@ -98,11 +99,11 @@ public class Product implements EventChildInterface {
this.name = productName; this.name = productName;
} }
public BigInteger getPrice() { public BigDecimal getPrice() {
return price; return price;
} }
public void setPrice(BigInteger price) { public void setPrice(BigDecimal price) {
this.price = price; this.price = price;
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!