InventoryEvent added, production -> development

1 parent 0314626d
package fi.insomnia.bortal.model;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import org.eclipse.persistence.annotations.OptimisticLocking;
import org.eclipse.persistence.annotations.OptimisticLockingType;
@Entity
@Table(name = "inventory_event")
@OptimisticLocking(type = OptimisticLockingType.CHANGED_COLUMNS)
public class InventoryEvent extends GenericEntity {
private static final long serialVersionUID = 1L;
@Column(name = "created", nullable = false)
@Temporal(TemporalType.TIMESTAMP)
private Date created = new Date();
@JoinColumn(name = "user_id")
private User user;
public Product getProduct() {
return product;
}
public void setProduct(Product product) {
this.product = product;
}
public String getInfo() {
return info;
}
public void setInfo(String info) {
this.info = info;
}
public int getCount() {
return count;
}
public void setCount(int count) {
this.count = count;
}
@JoinColumn(name = "product_id")
private Product product;
@Column(name = "info", nullable = true)
private String info;
@Column(name = "count", nullable=false)
private int count;
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
public Date getCreated() {
return created;
}
public void setCreated(Date created) {
this.created = created;
}
}
......@@ -91,6 +91,9 @@ public class Product extends GenericEntity {
@OneToMany(cascade = CascadeType.ALL, mappedBy = "product")
private List<AccountEvent> accountEvents;
@OneToMany(cascade = CascadeType.ALL, mappedBy = "product")
private List<InventoryEvent> inventoryEvents;
@ManyToMany(cascade = CascadeType.ALL)
@JoinTable(name = "product_discounts",
......@@ -304,4 +307,12 @@ public class Product extends GenericEntity {
this.buyInPrice = buyInPrice;
}
public List<InventoryEvent> getInventoryEvents() {
return inventoryEvents;
}
public void setInventoryEvents(List<InventoryEvent> inventoryEvents) {
this.inventoryEvents = inventoryEvents;
}
}
......@@ -9,8 +9,8 @@
</session-config>
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Production</param-value>
<!-- <param-value>Development</param-value> -->
<!-- param-value>Production</param-value -->
<param-value>Development</param-value>
</context-param>
<context-param>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!