196 lines
3.2 KiB
Java
196 lines
3.2 KiB
Java
package com.yourcompany.babydatenbank.model;
|
|
|
|
import javax.persistence.*;
|
|
|
|
import org.hibernate.annotations.GenericGenerator;
|
|
import org.openxava.annotations.*;
|
|
import java.math.BigDecimal;
|
|
import java.time.*;
|
|
|
|
@Entity
|
|
@View(members=
|
|
"name;" +
|
|
"photo;"+
|
|
"#category, pattern;"+
|
|
"#brand, size;"+
|
|
"buyAndSell[condition;"+
|
|
"#originalPrice, buyPrice, sellPrice;"+
|
|
"#buyDate, sellDate];" +
|
|
"remarks"
|
|
)
|
|
public class Article {
|
|
|
|
@Id @Hidden @GeneratedValue(generator="system-uuid") // Universally Unique Identifier (1)
|
|
@GenericGenerator(name="system-uuid", strategy = "uuid")
|
|
@Column(length=32)
|
|
private String oid;
|
|
|
|
@Column(length=32)
|
|
private String name;
|
|
|
|
@Stereotype("IMAGE")
|
|
@Column(length=83886080)
|
|
private byte[] photo;
|
|
|
|
@ManyToOne
|
|
@NoModify
|
|
@DescriptionsList
|
|
private Size size;
|
|
|
|
@ManyToOne
|
|
@NoModify
|
|
@DescriptionsList
|
|
private Pattern pattern;
|
|
|
|
@ManyToOne(optional=true, fetch = FetchType.EAGER)
|
|
@NoModify
|
|
@DescriptionsList
|
|
private Category category;
|
|
|
|
@ManyToOne
|
|
@NoModify
|
|
@DescriptionsList
|
|
private Brand brand;
|
|
|
|
@ManyToOne
|
|
@NoCreate
|
|
@NoModify
|
|
@DescriptionsList(order="${number} ASC")
|
|
private Condition condition;
|
|
|
|
@Stereotype("MONEY")
|
|
@Column(length=8)
|
|
private BigDecimal buyPrice;
|
|
|
|
@Stereotype("MONEY")
|
|
@Column(length=8)
|
|
private BigDecimal originalPrice;
|
|
|
|
@Stereotype("MONEY")
|
|
@Column(length=8)
|
|
private BigDecimal sellPrice;
|
|
|
|
@Stereotype("MEMO")
|
|
private String remarks;
|
|
|
|
@Stereotype("DATE")
|
|
private LocalDate buyDate;
|
|
|
|
@Stereotype("DATE")
|
|
private LocalDate sellDate;
|
|
|
|
public String getOid() {
|
|
return oid;
|
|
}
|
|
|
|
public void setOid(String oid) {
|
|
this.oid = oid;
|
|
}
|
|
|
|
public String getName() {
|
|
return name;
|
|
}
|
|
|
|
public void setName(String name) {
|
|
this.name = name;
|
|
}
|
|
|
|
public byte[] getPhoto() {
|
|
return photo;
|
|
}
|
|
|
|
public void setPhoto(byte[] photo) {
|
|
this.photo = photo;
|
|
}
|
|
|
|
public Size getSize() {
|
|
return size;
|
|
}
|
|
|
|
public void setSize(Size size) {
|
|
this.size = size;
|
|
}
|
|
|
|
public Pattern getPattern() {
|
|
return pattern;
|
|
}
|
|
|
|
public void setPattern(Pattern pattern) {
|
|
this.pattern = pattern;
|
|
}
|
|
|
|
public BigDecimal getBuyPrice() {
|
|
return buyPrice;
|
|
}
|
|
|
|
public void setBuyPrice(BigDecimal buyPrice) {
|
|
this.buyPrice = buyPrice;
|
|
}
|
|
|
|
public BigDecimal getOriginalPrice() {
|
|
return originalPrice;
|
|
}
|
|
|
|
public void setOriginalPrice(BigDecimal originalPrice) {
|
|
this.originalPrice = originalPrice;
|
|
}
|
|
|
|
public BigDecimal getSellPrice() {
|
|
return sellPrice;
|
|
}
|
|
|
|
public void setSellPrice(BigDecimal sellPrice) {
|
|
this.sellPrice = sellPrice;
|
|
}
|
|
|
|
public String getRemarks() {
|
|
return remarks;
|
|
}
|
|
|
|
public void setRemarks(String remarks) {
|
|
this.remarks = remarks;
|
|
}
|
|
|
|
public Category getCategory() {
|
|
return category;
|
|
}
|
|
|
|
public void setCategory(Category category) {
|
|
this.category = category;
|
|
}
|
|
|
|
public Brand getBrand() {
|
|
return brand;
|
|
}
|
|
|
|
public void setBrand(Brand brand) {
|
|
this.brand = brand;
|
|
}
|
|
|
|
public Condition getCondition() {
|
|
return condition;
|
|
}
|
|
|
|
public void setCondition(Condition condition) {
|
|
this.condition = condition;
|
|
}
|
|
|
|
public LocalDate getBuyDate() {
|
|
return buyDate;
|
|
}
|
|
|
|
public void setBuyDate(LocalDate buyDate) {
|
|
this.buyDate = buyDate;
|
|
}
|
|
|
|
public LocalDate getSellDate() {
|
|
return sellDate;
|
|
}
|
|
|
|
public void setSellDate(LocalDate sellDate) {
|
|
this.sellDate = sellDate;
|
|
}
|
|
|
|
|
|
}
|