count -> quantity, bigdesimals

1 parent d5470a06
package fi.insomnia.bortal.model; package fi.insomnia.bortal.model;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import javax.persistence.Column; import javax.persistence.Column;
...@@ -13,7 +14,7 @@ import org.eclipse.persistence.annotations.OptimisticLocking; ...@@ -13,7 +14,7 @@ import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType; import org.eclipse.persistence.annotations.OptimisticLockingType;
@Entity @Entity
@Table(name = "inventory_event") @Table(name = "inventory_events")
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS) @OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class InventoryEvent extends GenericEntity { public class InventoryEvent extends GenericEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
...@@ -41,22 +42,14 @@ public class InventoryEvent extends GenericEntity { ...@@ -41,22 +42,14 @@ public class InventoryEvent extends GenericEntity {
this.info = info; this.info = info;
} }
public int getCount() {
return count;
}
public void setCount(int count) {
this.count = count;
}
@JoinColumn(name = "product_id") @JoinColumn(name = "product_id")
private Product product; private Product product;
@Column(name = "info", nullable = true) @Column(name = "info", nullable = true)
private String info; private String info;
@Column(name = "count", nullable=false) @Column(name = "quantity", nullable = false, precision = 24, scale = 4)
private int count; private BigDecimal quantity;
...@@ -76,5 +69,13 @@ public class InventoryEvent extends GenericEntity { ...@@ -76,5 +69,13 @@ public class InventoryEvent extends GenericEntity {
this.created = created; this.created = created;
} }
public BigDecimal getQuantity() {
return quantity;
}
public void setQuantity(BigDecimal quantity) {
this.quantity = quantity;
}
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!