This commit is contained in:
Socrates
2020-05-26 10:29:34 +02:00
commit 9ed0f2a056
1162 changed files with 162062 additions and 0 deletions

17
src/_run/DBManager.java Normal file
View 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();
}
}

View 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
}
}

View 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;
}
}

View 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;
}
}

View 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;
}
}

View 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;
}
}

View 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;
}
}

View 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;
}
}