test
This commit is contained in:
17
src/_run/DBManager.java
Normal file
17
src/_run/DBManager.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package _run;
|
||||
|
||||
import org.openxava.util.*;
|
||||
|
||||
/**
|
||||
* Execute this class to start a manager for you development database.
|
||||
*
|
||||
* With Eclipse: Right mouse button > Run As > Java Application
|
||||
*/
|
||||
|
||||
public class DBManager {
|
||||
|
||||
public static void main(String[] args) {
|
||||
DBServer.runManager();
|
||||
}
|
||||
|
||||
}
|
||||
18
src/_run/_Run_Babydatenbank.java
Normal file
18
src/_run/_Run_Babydatenbank.java
Normal file
@@ -0,0 +1,18 @@
|
||||
package _run;
|
||||
|
||||
import org.openxava.util.*;
|
||||
|
||||
/**
|
||||
* Execute this class to start the application.
|
||||
*
|
||||
* With Eclipse: Right mouse button > Run As > Java Application
|
||||
*/
|
||||
|
||||
public class _Run_Babydatenbank {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
DBServer.start("BabydatenbankDB"); // To use your own database comment this line and configure web/META-INF/context.xml
|
||||
AppServer.run("Babydatenbank"); // Use AppServer.run("") to run in root context
|
||||
}
|
||||
|
||||
}
|
||||
197
src/com/yourcompany/babydatenbank/model/Article.java
Normal file
197
src/com/yourcompany/babydatenbank/model/Article.java
Normal file
@@ -0,0 +1,197 @@
|
||||
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(fetch=FetchType.LAZY, optional=true)
|
||||
@NoModify
|
||||
@DescriptionsList
|
||||
private Size size;
|
||||
|
||||
@ManyToOne(fetch=FetchType.LAZY, optional=true)
|
||||
@NoModify
|
||||
@DescriptionsList
|
||||
private Pattern pattern;
|
||||
|
||||
@ManyToOne(fetch=FetchType.LAZY, optional=true)
|
||||
@NoModify
|
||||
@DescriptionsList
|
||||
private Category category;
|
||||
|
||||
@ManyToOne(fetch=FetchType.LAZY, optional=true)
|
||||
@NoModify
|
||||
@DescriptionsList
|
||||
private Brand brand;
|
||||
|
||||
@ManyToOne(fetch=FetchType.LAZY, optional=true)
|
||||
@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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
36
src/com/yourcompany/babydatenbank/model/Brand.java
Normal file
36
src/com/yourcompany/babydatenbank/model/Brand.java
Normal file
@@ -0,0 +1,36 @@
|
||||
package com.yourcompany.babydatenbank.model;
|
||||
|
||||
import javax.persistence.*;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
import org.openxava.annotations.*;
|
||||
|
||||
@Entity
|
||||
public class Brand {
|
||||
|
||||
@Id
|
||||
@Hidden
|
||||
@GeneratedValue(generator="system-uuid") // Universally Unique Identifier (1)
|
||||
@GenericGenerator(name="system-uuid", strategy = "uuid")
|
||||
@Column(length=32)
|
||||
private String oid;
|
||||
|
||||
@Column(length=20)
|
||||
private String description;
|
||||
|
||||
public String getOid() {
|
||||
return oid;
|
||||
}
|
||||
|
||||
public void setOid(String oid) {
|
||||
this.oid = oid;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
}
|
||||
37
src/com/yourcompany/babydatenbank/model/Category.java
Normal file
37
src/com/yourcompany/babydatenbank/model/Category.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.yourcompany.babydatenbank.model;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
import org.openxava.annotations.*;
|
||||
|
||||
@Entity
|
||||
public class Category {
|
||||
@Id
|
||||
@Hidden
|
||||
@GeneratedValue(generator="system-uuid")
|
||||
@GenericGenerator(name="system-uuid", strategy = "uuid")
|
||||
@Column(length=32)
|
||||
private String oid;
|
||||
|
||||
@Column(length=20)
|
||||
private String description;
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getOid() {
|
||||
return oid;
|
||||
}
|
||||
|
||||
public void setOid(String oid) {
|
||||
this.oid = oid;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
46
src/com/yourcompany/babydatenbank/model/Condition.java
Normal file
46
src/com/yourcompany/babydatenbank/model/Condition.java
Normal file
@@ -0,0 +1,46 @@
|
||||
package com.yourcompany.babydatenbank.model;
|
||||
|
||||
import javax.persistence.*;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
import org.openxava.annotations.*;
|
||||
|
||||
@Entity
|
||||
public class Condition {
|
||||
@Id
|
||||
@Hidden
|
||||
@GeneratedValue(generator="system-uuid") // Universally Unique Identifier (1)
|
||||
@GenericGenerator(name="system-uuid", strategy = "uuid")
|
||||
@Column(length=32)
|
||||
private String oid;
|
||||
|
||||
@Column(length=4)
|
||||
private int number;
|
||||
|
||||
@Column(length=32)
|
||||
private String description;
|
||||
|
||||
public String getOid() {
|
||||
return oid;
|
||||
}
|
||||
|
||||
public void setOid(String oid) {
|
||||
this.oid = oid;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public int getNumber() {
|
||||
return this.number;
|
||||
}
|
||||
|
||||
public void setNumber(int number) {
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
}
|
||||
37
src/com/yourcompany/babydatenbank/model/Pattern.java
Normal file
37
src/com/yourcompany/babydatenbank/model/Pattern.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.yourcompany.babydatenbank.model;
|
||||
|
||||
import javax.persistence.*;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
import org.openxava.annotations.*;
|
||||
|
||||
@Entity
|
||||
public class Pattern {
|
||||
|
||||
@Id
|
||||
@Hidden
|
||||
@GeneratedValue(generator="system-uuid") // Universally Unique Identifier (1)
|
||||
@GenericGenerator(name="system-uuid", strategy = "uuid")
|
||||
@Column(length=32)
|
||||
private String oid;
|
||||
|
||||
@Column(length=20)
|
||||
private String description;
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getOid() {
|
||||
return oid;
|
||||
}
|
||||
|
||||
public void setOid(String oid) {
|
||||
this.oid = oid;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
37
src/com/yourcompany/babydatenbank/model/Size.java
Normal file
37
src/com/yourcompany/babydatenbank/model/Size.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.yourcompany.babydatenbank.model;
|
||||
|
||||
import javax.persistence.*;
|
||||
import org.openxava.annotations.*;
|
||||
import org.hibernate.annotations.GenericGenerator;
|
||||
|
||||
@Entity
|
||||
public class Size {
|
||||
|
||||
@Id
|
||||
@Hidden
|
||||
@GeneratedValue(generator="system-uuid") // Universally Unique Identifier (1)
|
||||
@GenericGenerator(name="system-uuid", strategy = "uuid")
|
||||
@Column(length=32)
|
||||
private String oid;
|
||||
|
||||
@Column(length=20)
|
||||
private String description;
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getOid() {
|
||||
return oid;
|
||||
}
|
||||
|
||||
public void setOid(String oid) {
|
||||
this.oid = oid;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user