2
0
Fork 0

removed some magic from jpa.

This commit is contained in:
Willem Cazander 2014-08-25 22:27:59 +02:00
parent 30418cad13
commit e643a69308
18 changed files with 157 additions and 206 deletions

View file

@ -90,7 +90,6 @@ public interface VascBackend<DATA_OBJECT extends Serializable> {
long doRecordMoveUpById(VascBackendState state,Object primaryId) throws VascBackendException; long doRecordMoveUpById(VascBackendState state,Object primaryId) throws VascBackendException;
long doRecordMoveDownById(VascBackendState state,Object primaryId) throws VascBackendException; long doRecordMoveDownById(VascBackendState state,Object primaryId) throws VascBackendException;
boolean hasPageSummary(); boolean hasPageSummary();
boolean hasTotalSummary(); boolean hasTotalSummary();

View file

@ -232,9 +232,11 @@ public enum VascTechDemoStartup {
serverConfigService.stop(); serverConfigService.stop();
tomcatService.stop(); tomcatService.stop();
databaseService.stop(); databaseService.stop();
swingGuiService.stop();
long stopTime = System.currentTimeMillis(); long stopTime = System.currentTimeMillis();
logger.info("VascTechDemo shutdown in "+(stopTime-startTime)+" ms."); logger.info("VascTechDemo shutdown in "+(stopTime-startTime)+" ms.");
swingGuiService.stop();// fixme kills logging
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
System.exit(1); System.exit(1);

View file

@ -115,13 +115,13 @@ public class ServerGuiApplication extends SingleFrameApplication {
updateInfoTask.run=false; // app will exit so stop update updateInfoTask.run=false; // app will exit so stop update
return true; return true;
} else { } else {
logger.finer("Closing application window."); logger.info("Closing application window.");
updateInfoTask.doUpdate=false; // close window updateInfoTask.doUpdate=false; // close window
ServerGuiApplication.getInstance().getMainFrame().setVisible(false); ServerGuiApplication.getInstance().getMainFrame().setVisible(false);
return false; return false;
} }
} }
@Override @Override
public void willExit(EventObject event) { public void willExit(EventObject event) {
} }
@ -150,7 +150,7 @@ public class ServerGuiApplication extends SingleFrameApplication {
static public ServerGuiApplication getInstance() { static public ServerGuiApplication getInstance() {
return getInstance(ServerGuiApplication.class); return getInstance(ServerGuiApplication.class);
} }
private void startSystemTray() { private void startSystemTray() {
if (!SystemTray.isSupported()) { if (!SystemTray.isSupported()) {
return; return;
@ -158,7 +158,7 @@ public class ServerGuiApplication extends SingleFrameApplication {
final PopupMenu popup = new PopupMenu(); final PopupMenu popup = new PopupMenu();
final TrayIcon trayIcon = new TrayIcon(createImageIcon("/net/forwardfire/vasc/demo/server/ui/resources/tray-icon.png", "tray icon").getImage()); final TrayIcon trayIcon = new TrayIcon(createImageIcon("/net/forwardfire/vasc/demo/server/ui/resources/tray-icon.png", "tray icon").getImage());
final SystemTray tray = SystemTray.getSystemTray(); final SystemTray tray = SystemTray.getSystemTray();
MenuItem aboutItem = new MenuItem("About"); MenuItem aboutItem = new MenuItem("About");
aboutItem.addActionListener(new ActionListener() { aboutItem.addActionListener(new ActionListener() {
@Override @Override
@ -185,7 +185,6 @@ public class ServerGuiApplication extends SingleFrameApplication {
} }
}); });
popup.add(exitItem); popup.add(exitItem);
popup.addSeparator(); popup.addSeparator();
popup.add(aboutItem); popup.add(aboutItem);
@ -196,7 +195,7 @@ public class ServerGuiApplication extends SingleFrameApplication {
try { try {
tray.add(trayIcon); tray.add(trayIcon);
} catch (AWTException e) { } catch (AWTException e) {
System.out.println("TrayIcon could not be added."); logger.warning("TrayIcon could not be added.");
} }
} }
@ -212,7 +211,7 @@ public class ServerGuiApplication extends SingleFrameApplication {
UIManager.put("TabbedPane.font", Font.decode("SansSerif-BOLD-12")); UIManager.put("TabbedPane.font", Font.decode("SansSerif-BOLD-12"));
UIManager.put("TitledBorder.font", Font.decode("SansSerif-BOLD-16")); UIManager.put("TitledBorder.font", Font.decode("SansSerif-BOLD-16"));
UIManager.put("FireDial.font", Font.decode("SansSerif-9")); UIManager.put("FireDial.font", Font.decode("SansSerif-9"));
String colorName = "laf-colors"; String colorName = "laf-colors";
ClassLoader cl = Thread.currentThread().getContextClassLoader(); ClassLoader cl = Thread.currentThread().getContextClassLoader();
if (cl==null) { if (cl==null) {

View file

@ -1,5 +1,25 @@
package net.forwardfire.vasc.demo.tech.domain.petstore.model; package net.forwardfire.vasc.demo.tech.domain.petstore.model;
abstract public class AbstractPetStoreEntity { import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Id;
import net.forwardfire.vasc.annotations.VascFieldTemplate;
@SuppressWarnings("serial")
abstract public class AbstractPetStoreEntity implements Serializable {
private Long id;
@Id
@Column(name=AbstractPetStoreDBColumn.ID,nullable=false)
@VascFieldTemplate(templateClass=AbstractPetStoreVascFieldTemplate.class)
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
} }

View file

@ -15,40 +15,39 @@ import net.forwardfire.vasc.validators.VascObjectNotNull;
import net.forwardfire.vasc.validators.VascStringLength; import net.forwardfire.vasc.validators.VascStringLength;
abstract public class AbstractPetStoreFieldTemplates { abstract public class AbstractPetStoreVascFieldTemplate {
/** /**
* Template for field ids. * Template for field ids.
*/ */
@VascPrimaryKey @VascPrimaryKey
@VascI18n(name="generic.id.labelText",description="generic.id.toolTipText") @VascI18n(name="generic.id.labelText",description="generic.id.toolTipText")
@VascStyle(sizeList=50) @VascStyle(sizeList=50)
@VascField(create=false,editReadOnly=true) @VascField(create=false,editReadOnly=true)
@VascFieldOrder(order=0) @VascFieldOrder(order=0)
abstract public Integer getId(); abstract public Long getId();
/** /**
* Template for field names. * Template for field names.
*/ */
@VascDisplayName @VascDisplayName
@VascI18n(name="generic.name.labelText",description="generic.name.toolTipText") @VascI18n(name="generic.name.labelText",description="generic.name.toolTipText")
@VascObjectNotNull @VascObjectNotNull
@VascStringLength(min=4,max=128) @VascStringLength(min=4,max=128)
@VascStyle(sizeList=250,sizeEdit=40) @VascStyle(sizeList=250,sizeEdit=40)
@VascFieldOrder(order=1) @VascFieldOrder(order=1)
abstract public String getName(); abstract public String getName();
/** /**
* Template for description field names. * Template for description field names.
*/ */
@VascI18n(name="generic.description.labelText",description="generic.description.toolTipText") @VascI18n(name="generic.description.labelText",description="generic.description.toolTipText")
@VascFieldType(type="TextAreaField",properties={"editor.columns=40","editor.rows=5"}) @VascFieldType(type="TextAreaField",properties={"editor.columns=40","editor.rows=5"})
@VascDefaultValue(value="") @VascDefaultValue(value="")
@VascField(list=false) @VascField(list=false)
@VascStringLength(max=4096) @VascStringLength(max=4096)
@VascObjectNotNull @VascObjectNotNull
@VascFieldOrder(order=2) @VascFieldOrder(order=2)
abstract public String getDescription(); abstract public String getDescription();
/** /**

View file

@ -2,45 +2,35 @@ package net.forwardfire.vasc.demo.tech.domain.petstore.model;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table; import javax.persistence.Table;
import net.forwardfire.vasc.annotations.VascField; import net.forwardfire.vasc.annotations.VascField;
import net.forwardfire.vasc.annotations.VascFieldTemplate; import net.forwardfire.vasc.annotations.VascFieldTemplate;
@Entity @Entity
@Table(name="category",schema="petstore") @Table(name=AbstractPetStoreDBTable.CATEGORY,schema=AbstractPetStoreDBCatalog.SCHEMA)
public class Category extends AbstractPetStoreEntity{ public class Category extends AbstractPetStoreEntity {
private Integer id = null;
private String name = null; private String name = null;
private String description = null; private String description = null;
private String iconUrl = null; private String iconUrl = null;
@Id
@Column(name="id",nullable=false)
@VascFieldTemplate(templateClass=AbstractPetStoreFieldTemplates.class)
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
@Column(name="name",nullable=false) @Column(name="name",nullable=false)
@VascFieldTemplate(templateClass=AbstractPetStoreFieldTemplates.class) @VascFieldTemplate(templateClass=AbstractPetStoreVascFieldTemplate.class)
public String getName() { public String getName() {
return name; return name;
} }
public void setName(String name) { public void setName(String name) {
this.name = name; this.name = name;
} }
@Column(name="description",nullable=false) @Column(name="description",nullable=false)
@VascFieldTemplate(templateClass=AbstractPetStoreFieldTemplates.class) @VascFieldTemplate(templateClass=AbstractPetStoreVascFieldTemplate.class)
public String getDescription() { public String getDescription() {
return description; return description;
} }
public void setDescription(String description) { public void setDescription(String description) {
this.description = description; this.description = description;
} }
@ -50,6 +40,7 @@ public class Category extends AbstractPetStoreEntity{
public String getIconUrl() { public String getIconUrl() {
return iconUrl; return iconUrl;
} }
public void setIconUrl(String iconUrl) { public void setIconUrl(String iconUrl) {
this.iconUrl = iconUrl; this.iconUrl = iconUrl;
} }

View file

@ -3,33 +3,23 @@ package net.forwardfire.vasc.demo.tech.domain.petstore.model;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.FetchType; import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn; import javax.persistence.JoinColumn;
import javax.persistence.OneToOne; import javax.persistence.OneToOne;
import javax.persistence.Table;
import net.forwardfire.vasc.annotations.VascField; import net.forwardfire.vasc.annotations.VascField;
import net.forwardfire.vasc.annotations.VascFieldTemplate; import net.forwardfire.vasc.annotations.VascFieldTemplate;
import net.forwardfire.vasc.annotations.VascModelReference; import net.forwardfire.vasc.annotations.VascModelReference;
@Entity @Entity
@Table(name=AbstractPetStoreDBTable.CATEGORY_PRODUCT,schema=AbstractPetStoreDBCatalog.SCHEMA)
public class CategoryProduct extends AbstractPetStoreEntity { public class CategoryProduct extends AbstractPetStoreEntity {
private Integer id = null;
private Category category = null; private Category category = null;
private String name = null; private String name = null;
private String description = null; private String description = null;
private String iconUrl = null; private String iconUrl = null;
@Id
@Column(name="id",nullable=false)
@VascFieldTemplate(templateClass=AbstractPetStoreFieldTemplates.class)
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
@OneToOne(fetch=FetchType.LAZY) @OneToOne(fetch=FetchType.LAZY)
@JoinColumn(name="category_id",nullable=false) @JoinColumn(name="category_id",nullable=false)
@VascModelReference @VascModelReference
@ -41,7 +31,7 @@ public class CategoryProduct extends AbstractPetStoreEntity {
} }
@Column(name="name",nullable=false) @Column(name="name",nullable=false)
@VascFieldTemplate(templateClass=AbstractPetStoreFieldTemplates.class) @VascFieldTemplate(templateClass=AbstractPetStoreVascFieldTemplate.class)
public String getName() { public String getName() {
return name; return name;
} }
@ -50,7 +40,7 @@ public class CategoryProduct extends AbstractPetStoreEntity {
} }
@Column(name="description",nullable=false) @Column(name="description",nullable=false)
@VascFieldTemplate(templateClass=AbstractPetStoreFieldTemplates.class) @VascFieldTemplate(templateClass=AbstractPetStoreVascFieldTemplate.class)
public String getDescription() { public String getDescription() {
return description; return description;
} }

View file

@ -6,14 +6,15 @@ import javax.persistence.FetchType;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.JoinColumn; import javax.persistence.JoinColumn;
import javax.persistence.OneToOne; import javax.persistence.OneToOne;
import javax.persistence.Table;
import net.forwardfire.vasc.annotations.VascFieldTemplate; import net.forwardfire.vasc.annotations.VascFieldTemplate;
import net.forwardfire.vasc.annotations.VascModelReference; import net.forwardfire.vasc.annotations.VascModelReference;
@Entity @Entity
@Table(name=AbstractPetStoreDBTable.ITEM,schema=AbstractPetStoreDBCatalog.SCHEMA)
public class Item extends AbstractPetStoreEntity { public class Item extends AbstractPetStoreEntity {
private Integer id = null;
private CategoryProduct categoryProduct = null; private CategoryProduct categoryProduct = null;
private ItemSupplier itemSupplier = null; private ItemSupplier itemSupplier = null;
private Float price = null; private Float price = null;
@ -21,16 +22,6 @@ public class Item extends AbstractPetStoreEntity {
private String name = null; private String name = null;
private String description = null; private String description = null;
@Id
@Column(name="id",nullable=false)
@VascFieldTemplate(templateClass=AbstractPetStoreFieldTemplates.class)
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
@OneToOne(fetch=FetchType.LAZY) @OneToOne(fetch=FetchType.LAZY)
@JoinColumn(name="category_product_id",nullable=false) @JoinColumn(name="category_product_id",nullable=false)
@VascModelReference @VascModelReference
@ -69,7 +60,7 @@ public class Item extends AbstractPetStoreEntity {
@Column(name="name",nullable=false) @Column(name="name",nullable=false)
@VascFieldTemplate(templateClass=AbstractPetStoreFieldTemplates.class) @VascFieldTemplate(templateClass=AbstractPetStoreVascFieldTemplate.class)
public String getName() { public String getName() {
return name; return name;
} }
@ -79,7 +70,7 @@ public class Item extends AbstractPetStoreEntity {
@Column(name="description",nullable=false) @Column(name="description",nullable=false)
@VascFieldTemplate(templateClass=AbstractPetStoreFieldTemplates.class) @VascFieldTemplate(templateClass=AbstractPetStoreVascFieldTemplate.class)
public String getDescription() { public String getDescription() {
return description; return description;
} }

View file

@ -6,27 +6,18 @@ import javax.persistence.FetchType;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.JoinColumn; import javax.persistence.JoinColumn;
import javax.persistence.OneToOne; import javax.persistence.OneToOne;
import javax.persistence.Table;
import net.forwardfire.vasc.annotations.VascFieldTemplate; import net.forwardfire.vasc.annotations.VascFieldTemplate;
import net.forwardfire.vasc.annotations.VascModelReference; import net.forwardfire.vasc.annotations.VascModelReference;
@Entity @Entity
@Table(name=AbstractPetStoreDBTable.ITEM_INVENTORY,schema=AbstractPetStoreDBCatalog.SCHEMA)
public class ItemInventory extends AbstractPetStoreEntity { public class ItemInventory extends AbstractPetStoreEntity {
private Integer id = null;
private Item item = null; private Item item = null;
private Integer inventoryCount = null; private Integer inventoryCount = null;
@Id
@Column(name="id",nullable=false)
@VascFieldTemplate(templateClass=AbstractPetStoreFieldTemplates.class)
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
@OneToOne(fetch=FetchType.LAZY) @OneToOne(fetch=FetchType.LAZY)
@JoinColumn(name="item_id",nullable=false) @JoinColumn(name="item_id",nullable=false)
@VascModelReference @VascModelReference

View file

@ -3,30 +3,21 @@ package net.forwardfire.vasc.demo.tech.domain.petstore.model;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.Table;
import net.forwardfire.vasc.annotations.VascField; import net.forwardfire.vasc.annotations.VascField;
import net.forwardfire.vasc.annotations.VascFieldTemplate; import net.forwardfire.vasc.annotations.VascFieldTemplate;
@Entity @Entity
@Table(name=AbstractPetStoreDBTable.ITEM_SUPPLIER,schema=AbstractPetStoreDBCatalog.SCHEMA)
public class ItemSupplier extends AbstractPetStoreEntity { public class ItemSupplier extends AbstractPetStoreEntity {
private Integer id = null;
private String name = null; private String name = null;
private String description = null; private String description = null;
private String website = null; private String website = null;
@Id
@Column(name="id",nullable=false)
@VascFieldTemplate(templateClass=AbstractPetStoreFieldTemplates.class)
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
@Column(name="name",nullable=false) @Column(name="name",nullable=false)
@VascFieldTemplate(templateClass=AbstractPetStoreFieldTemplates.class) @VascFieldTemplate(templateClass=AbstractPetStoreVascFieldTemplate.class)
public String getName() { public String getName() {
return name; return name;
} }
@ -35,7 +26,7 @@ public class ItemSupplier extends AbstractPetStoreEntity {
} }
@Column(name="description",nullable=false) @Column(name="description",nullable=false)
@VascFieldTemplate(templateClass=AbstractPetStoreFieldTemplates.class) @VascFieldTemplate(templateClass=AbstractPetStoreVascFieldTemplate.class)
public String getDescription() { public String getDescription() {
return description; return description;
} }

View file

@ -5,18 +5,17 @@ import java.util.Date;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.FetchType; import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn; import javax.persistence.JoinColumn;
import javax.persistence.OneToOne; import javax.persistence.OneToOne;
import javax.persistence.Table;
import net.forwardfire.vasc.annotations.VascField; import net.forwardfire.vasc.annotations.VascField;
import net.forwardfire.vasc.annotations.VascFieldTemplate;
import net.forwardfire.vasc.annotations.VascModelReference; import net.forwardfire.vasc.annotations.VascModelReference;
@Entity @Entity
@Table(name=AbstractPetStoreDBTable.ORDER,schema=AbstractPetStoreDBCatalog.SCHEMA)
public class Order extends AbstractPetStoreEntity { public class Order extends AbstractPetStoreEntity {
private Integer id = null;
private UserAccount userAccount = null; private UserAccount userAccount = null;
private Date orderDate = null; private Date orderDate = null;
private Date shipDate = null; private Date shipDate = null;
@ -33,22 +32,13 @@ public class Order extends AbstractPetStoreEntity {
private String billZipCode = null; private String billZipCode = null;
private String billCountry = null; private String billCountry = null;
@Id @OneToOne(fetch=FetchType.LAZY)
@Column(name="id",nullable=false) @JoinColumn(name="user_account_id",nullable=false)
@VascFieldTemplate(templateClass=AbstractPetStoreFieldTemplates.class) @VascModelReference
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
@OneToOne(fetch=FetchType.LAZY)
@JoinColumn(name="user_account_id",nullable=false)
@VascModelReference
public UserAccount getUserAccount() { public UserAccount getUserAccount() {
return userAccount; return userAccount;
} }
public void setUserAccount(UserAccount userAccount) { public void setUserAccount(UserAccount userAccount) {
this.userAccount = userAccount; this.userAccount = userAccount;
} }
@ -57,6 +47,7 @@ public class Order extends AbstractPetStoreEntity {
public Date getOrderDate() { public Date getOrderDate() {
return orderDate; return orderDate;
} }
public void setOrderDate(Date orderDate) { public void setOrderDate(Date orderDate) {
this.orderDate = orderDate; this.orderDate = orderDate;
} }
@ -66,6 +57,7 @@ public class Order extends AbstractPetStoreEntity {
public Date getShipDate() { public Date getShipDate() {
return shipDate; return shipDate;
} }
public void setShipDate(Date shipDate) { public void setShipDate(Date shipDate) {
this.shipDate = shipDate; this.shipDate = shipDate;
} }
@ -75,6 +67,7 @@ public class Order extends AbstractPetStoreEntity {
public String getShipAddr1() { public String getShipAddr1() {
return shipAddr1; return shipAddr1;
} }
public void setShipAddr1(String shipAddr1) { public void setShipAddr1(String shipAddr1) {
this.shipAddr1 = shipAddr1; this.shipAddr1 = shipAddr1;
} }
@ -84,6 +77,7 @@ public class Order extends AbstractPetStoreEntity {
public String getShipAddr2() { public String getShipAddr2() {
return shipAddr2; return shipAddr2;
} }
public void setShipAddr2(String shipAddr2) { public void setShipAddr2(String shipAddr2) {
this.shipAddr2 = shipAddr2; this.shipAddr2 = shipAddr2;
} }
@ -93,6 +87,7 @@ public class Order extends AbstractPetStoreEntity {
public String getShipCity() { public String getShipCity() {
return shipCity; return shipCity;
} }
public void setShipCity(String shipCity) { public void setShipCity(String shipCity) {
this.shipCity = shipCity; this.shipCity = shipCity;
} }
@ -102,6 +97,7 @@ public class Order extends AbstractPetStoreEntity {
public String getShipZipCode() { public String getShipZipCode() {
return shipZipCode; return shipZipCode;
} }
public void setShipZipCode(String shipZipCode) { public void setShipZipCode(String shipZipCode) {
this.shipZipCode = shipZipCode; this.shipZipCode = shipZipCode;
} }
@ -111,6 +107,7 @@ public class Order extends AbstractPetStoreEntity {
public String getShipCountry() { public String getShipCountry() {
return shipCountry; return shipCountry;
} }
public void setShipCountry(String shipCountry) { public void setShipCountry(String shipCountry) {
this.shipCountry = shipCountry; this.shipCountry = shipCountry;
} }
@ -120,6 +117,7 @@ public class Order extends AbstractPetStoreEntity {
public String getBillAddr1() { public String getBillAddr1() {
return billAddr1; return billAddr1;
} }
public void setBillAddr1(String billAddr1) { public void setBillAddr1(String billAddr1) {
this.billAddr1 = billAddr1; this.billAddr1 = billAddr1;
} }
@ -129,6 +127,7 @@ public class Order extends AbstractPetStoreEntity {
public String getBillAddr2() { public String getBillAddr2() {
return billAddr2; return billAddr2;
} }
public void setBillAddr2(String billAddr2) { public void setBillAddr2(String billAddr2) {
this.billAddr2 = billAddr2; this.billAddr2 = billAddr2;
} }
@ -138,6 +137,7 @@ public class Order extends AbstractPetStoreEntity {
public String getBillCity() { public String getBillCity() {
return billCity; return billCity;
} }
public void setBillCity(String billCity) { public void setBillCity(String billCity) {
this.billCity = billCity; this.billCity = billCity;
} }
@ -147,6 +147,7 @@ public class Order extends AbstractPetStoreEntity {
public String getBillZipCode() { public String getBillZipCode() {
return billZipCode; return billZipCode;
} }
public void setBillZipCode(String billZipCode) { public void setBillZipCode(String billZipCode) {
this.billZipCode = billZipCode; this.billZipCode = billZipCode;
} }
@ -156,6 +157,7 @@ public class Order extends AbstractPetStoreEntity {
public String getBillCountry() { public String getBillCountry() {
return billCountry; return billCountry;
} }
public void setBillCountry(String billCountry) { public void setBillCountry(String billCountry) {
this.billCountry = billCountry; this.billCountry = billCountry;
} }

View file

@ -3,40 +3,30 @@ package net.forwardfire.vasc.demo.tech.domain.petstore.model;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.FetchType; import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn; import javax.persistence.JoinColumn;
import javax.persistence.OneToOne; import javax.persistence.OneToOne;
import javax.persistence.Table;
import net.forwardfire.vasc.annotations.VascField; import net.forwardfire.vasc.annotations.VascField;
import net.forwardfire.vasc.annotations.VascFieldTemplate;
import net.forwardfire.vasc.annotations.VascModelReference; import net.forwardfire.vasc.annotations.VascModelReference;
@Entity @Entity
@Table(name=AbstractPetStoreDBTable.ORDER_LINE,schema=AbstractPetStoreDBCatalog.SCHEMA)
public class OrderLine extends AbstractPetStoreEntity { public class OrderLine extends AbstractPetStoreEntity {
private Integer id = null;
private Order order = null; private Order order = null;
private Integer lineNumber = null; private Integer lineNumber = null;
private Item item = null; private Item item = null;
private Integer quantity = null; private Integer quantity = null;
private Float itemPrice = null; private Float itemPrice = null;
@Id @OneToOne(fetch=FetchType.LAZY)
@Column(name="id",nullable=false) @JoinColumn(name="order_id",nullable=false)
@VascFieldTemplate(templateClass=AbstractPetStoreFieldTemplates.class) @VascModelReference
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
@OneToOne(fetch=FetchType.LAZY)
@JoinColumn(name="order_id",nullable=false)
@VascModelReference
public Order getOrder() { public Order getOrder() {
return order; return order;
} }
public void setOrder(Order order) { public void setOrder(Order order) {
this.order = order; this.order = order;
} }
@ -46,16 +36,18 @@ public class OrderLine extends AbstractPetStoreEntity {
public Integer getLineNumber() { public Integer getLineNumber() {
return lineNumber; return lineNumber;
} }
public void setLineNumber(Integer lineNumber) { public void setLineNumber(Integer lineNumber) {
this.lineNumber = lineNumber; this.lineNumber = lineNumber;
} }
@OneToOne(fetch=FetchType.LAZY) @OneToOne(fetch=FetchType.LAZY)
@JoinColumn(name="item_id",nullable=false) @JoinColumn(name="item_id",nullable=false)
@VascModelReference @VascModelReference
public Item getItem() { public Item getItem() {
return item; return item;
} }
public void setItem(Item item) { public void setItem(Item item) {
this.item = item; this.item = item;
} }
@ -64,6 +56,7 @@ public class OrderLine extends AbstractPetStoreEntity {
public Integer getQuantity() { public Integer getQuantity() {
return quantity; return quantity;
} }
public void setQuantity(Integer quantity) { public void setQuantity(Integer quantity) {
this.quantity = quantity; this.quantity = quantity;
} }
@ -72,6 +65,7 @@ public class OrderLine extends AbstractPetStoreEntity {
public Float getItemPrice() { public Float getItemPrice() {
return itemPrice; return itemPrice;
} }
public void setItemPrice(Float itemPrice) { public void setItemPrice(Float itemPrice) {
this.itemPrice = itemPrice; this.itemPrice = itemPrice;
} }

View file

@ -3,61 +3,56 @@ package net.forwardfire.vasc.demo.tech.domain.petstore.model;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.Id; import javax.persistence.Id;
import javax.persistence.Table;
import net.forwardfire.vasc.annotations.VascField; import net.forwardfire.vasc.annotations.VascField;
import net.forwardfire.vasc.annotations.VascFieldTemplate; import net.forwardfire.vasc.annotations.VascFieldTemplate;
@Entity @Entity
@Table(name=AbstractPetStoreDBTable.ORDER_STATUS,schema=AbstractPetStoreDBCatalog.SCHEMA)
public class OrderStatus extends AbstractPetStoreEntity { public class OrderStatus extends AbstractPetStoreEntity {
private Integer id = null;
private String type = null; private String type = null;
private Boolean active = null; private Boolean active = null;
private String name = null; private String name = null;
private String description = null; private String description = null;
@Id
@Column(name="id",nullable=false)
@VascFieldTemplate(templateClass=AbstractPetStoreFieldTemplates.class)
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
@Column(name="type",nullable=false) @Column(name="type",nullable=false)
public String getType() { public String getType() {
return type; return type;
} }
public void setType(String type) { public void setType(String type) {
this.type = type; this.type = type;
} }
@Column(name="active",nullable=false) @Column(name="active",nullable=false)
@VascFieldTemplate(templateClass=AbstractPetStoreFieldTemplates.class) @VascFieldTemplate(templateClass=AbstractPetStoreVascFieldTemplate.class)
public Boolean getActive() { public Boolean getActive() {
return active; return active;
} }
public void setActive(Boolean active) { public void setActive(Boolean active) {
this.active = active; this.active = active;
} }
@Column(name="name",nullable=false) @Column(name="name",nullable=false)
@VascFieldTemplate(templateClass=AbstractPetStoreFieldTemplates.class) @VascFieldTemplate(templateClass=AbstractPetStoreVascFieldTemplate.class)
public String getName() { public String getName() {
return name; return name;
} }
public void setName(String name) { public void setName(String name) {
this.name = name; this.name = name;
} }
@Column(name="description",nullable=false) @Column(name="description",nullable=false)
@VascField(list=false) @VascField(list=false)
@VascFieldTemplate(templateClass=AbstractPetStoreFieldTemplates.class) @VascFieldTemplate(templateClass=AbstractPetStoreVascFieldTemplate.class)
public String getDescription() { public String getDescription() {
return description; return description;
} }
public void setDescription(String description) { public void setDescription(String description) {
this.description = description; this.description = description;
} }

View file

@ -2,15 +2,14 @@ package net.forwardfire.vasc.demo.tech.domain.petstore.model;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.Id; import javax.persistence.Table;
import net.forwardfire.vasc.annotations.VascField; import net.forwardfire.vasc.annotations.VascField;
import net.forwardfire.vasc.annotations.VascFieldTemplate;
@Entity @Entity
@Table(name=AbstractPetStoreDBTable.USER_ACCOUNT,schema=AbstractPetStoreDBCatalog.SCHEMA)
public class UserAccount extends AbstractPetStoreEntity { public class UserAccount extends AbstractPetStoreEntity {
private Integer id = null;
private String email = null; private String email = null;
private String firstName = null; private String firstName = null;
private String lastName = null; private String lastName = null;
@ -20,20 +19,11 @@ public class UserAccount extends AbstractPetStoreEntity {
private String country = null; private String country = null;
private String countryState = null; private String countryState = null;
@Id
@Column(name="id",nullable=false)
@VascFieldTemplate(templateClass=AbstractPetStoreFieldTemplates.class)
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
@Column(name="email",nullable=false) @Column(name="email",nullable=false)
public String getEmail() { public String getEmail() {
return email; return email;
} }
public void setEmail(String email) { public void setEmail(String email) {
this.email = email; this.email = email;
} }
@ -43,6 +33,7 @@ public class UserAccount extends AbstractPetStoreEntity {
public String getFirstName() { public String getFirstName() {
return firstName; return firstName;
} }
public void setFirstName(String firstName) { public void setFirstName(String firstName) {
this.firstName = firstName; this.firstName = firstName;
} }
@ -52,6 +43,7 @@ public class UserAccount extends AbstractPetStoreEntity {
public String getLastName() { public String getLastName() {
return lastName; return lastName;
} }
public void setLastName(String lastName) { public void setLastName(String lastName) {
this.lastName = lastName; this.lastName = lastName;
} }
@ -61,6 +53,7 @@ public class UserAccount extends AbstractPetStoreEntity {
public String getStreetName() { public String getStreetName() {
return streetName; return streetName;
} }
public void setStreetName(String streetName) { public void setStreetName(String streetName) {
this.streetName = streetName; this.streetName = streetName;
} }
@ -70,6 +63,7 @@ public class UserAccount extends AbstractPetStoreEntity {
public String getStreetNumber() { public String getStreetNumber() {
return streetNumber; return streetNumber;
} }
public void setStreetNumber(String streetNumber) { public void setStreetNumber(String streetNumber) {
this.streetNumber = streetNumber; this.streetNumber = streetNumber;
} }
@ -79,6 +73,7 @@ public class UserAccount extends AbstractPetStoreEntity {
public String getZipCode() { public String getZipCode() {
return zipCode; return zipCode;
} }
public void setZipCode(String zipCode) { public void setZipCode(String zipCode) {
this.zipCode = zipCode; this.zipCode = zipCode;
} }
@ -87,6 +82,7 @@ public class UserAccount extends AbstractPetStoreEntity {
public String getCountry() { public String getCountry() {
return country; return country;
} }
public void setCountry(String country) { public void setCountry(String country) {
this.country = country; this.country = country;
} }
@ -96,6 +92,7 @@ public class UserAccount extends AbstractPetStoreEntity {
public String getCountryState() { public String getCountryState() {
return countryState; return countryState;
} }
public void setCountryState(String countryState) { public void setCountryState(String countryState) {
this.countryState = countryState; this.countryState = countryState;
} }

View file

@ -3,18 +3,17 @@ package net.forwardfire.vasc.demo.tech.domain.petstore.model;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.FetchType; import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn; import javax.persistence.JoinColumn;
import javax.persistence.OneToOne; import javax.persistence.OneToOne;
import javax.persistence.Table;
import net.forwardfire.vasc.annotations.VascField; import net.forwardfire.vasc.annotations.VascField;
import net.forwardfire.vasc.annotations.VascFieldTemplate;
import net.forwardfire.vasc.annotations.VascModelReference; import net.forwardfire.vasc.annotations.VascModelReference;
@Entity @Entity
@Table(name=AbstractPetStoreDBTable.USER_CREDENTIAL,schema=AbstractPetStoreDBCatalog.SCHEMA)
public class UserCredential extends AbstractPetStoreEntity { public class UserCredential extends AbstractPetStoreEntity {
private Integer id = null;
private UserAccount userAccount = null; private UserAccount userAccount = null;
private String password = null; private String password = null;
private String secretQuestion0 = null; private String secretQuestion0 = null;
@ -22,19 +21,9 @@ public class UserCredential extends AbstractPetStoreEntity {
private String secretQuestion1 = null; private String secretQuestion1 = null;
private String secretAnswer1 = null; private String secretAnswer1 = null;
@Id @OneToOne(fetch=FetchType.LAZY)
@Column(name="id",nullable=false) @JoinColumn(name="user_account_id",nullable=false)
@VascFieldTemplate(templateClass=AbstractPetStoreFieldTemplates.class) @VascModelReference
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
@OneToOne(fetch=FetchType.LAZY)
@JoinColumn(name="user_account_id",nullable=false)
@VascModelReference
public UserAccount getUserAccount() { public UserAccount getUserAccount() {
return userAccount; return userAccount;
} }

View file

@ -3,81 +3,76 @@ package net.forwardfire.vasc.demo.tech.domain.petstore.model;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.FetchType; import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn; import javax.persistence.JoinColumn;
import javax.persistence.OneToOne; import javax.persistence.OneToOne;
import javax.persistence.Table;
import net.forwardfire.vasc.annotations.VascDefaultValue; import net.forwardfire.vasc.annotations.VascDefaultValue;
import net.forwardfire.vasc.annotations.VascField; import net.forwardfire.vasc.annotations.VascField;
import net.forwardfire.vasc.annotations.VascFieldTemplate;
import net.forwardfire.vasc.annotations.VascModelReference; import net.forwardfire.vasc.annotations.VascModelReference;
@Entity @Entity
@Table(name=AbstractPetStoreDBTable.USER_PROFILE,schema=AbstractPetStoreDBCatalog.SCHEMA)
public class UserProfile extends AbstractPetStoreEntity { public class UserProfile extends AbstractPetStoreEntity {
private Integer id = null;
private String signUpIp = null; private String signUpIp = null;
private String signUpAgent = null; private String signUpAgent = null;
private String locale = null; private String locale = null;
private UserAccount userAccount = null; private UserAccount userAccount = null;
private Category userCategory = null; private Category userCategory = null;
@Id @Column(name=AbstractPetStoreDBColumn.SIGNUP_IP,nullable=false)
@Column(name="id",nullable=false)
@VascFieldTemplate(templateClass=AbstractPetStoreFieldTemplates.class)
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
@Column(name="signup_ip",nullable=false)
@VascField(list=false) @VascField(list=false)
@VascDefaultValue(value="0.0.0.0") @VascDefaultValue(value="0.0.0.0")
public String getSignUpIp() { public String getSignUpIp() {
return signUpIp; return signUpIp;
} }
public void setSignUpIp(String signUpIp) { public void setSignUpIp(String signUpIp) {
this.signUpIp = signUpIp; this.signUpIp = signUpIp;
} }
@Column(name="signup_agent",nullable=false) @Column(name=AbstractPetStoreDBColumn.SIGNUP_AGENT,nullable=false)
@VascField(list=false) @VascField(list=false)
@VascDefaultValue(value="No-Agent") @VascDefaultValue(value="No-Agent")
public String getSignUpAgent() { public String getSignUpAgent() {
return signUpAgent; return signUpAgent;
} }
public void setSignUpAgent(String signUpAgent) { public void setSignUpAgent(String signUpAgent) {
this.signUpAgent = signUpAgent; this.signUpAgent = signUpAgent;
} }
@Column(name="locale",nullable=false) @Column(name=AbstractPetStoreDBColumn.LOCALE,nullable=false)
@VascField(list=false) @VascField(list=false)
@VascDefaultValue(value="nl_NL") @VascDefaultValue(value="nl_NL")
public String getLocale() { public String getLocale() {
return locale; return locale;
} }
public void setLocale(String locale) { public void setLocale(String locale) {
this.locale = locale; this.locale = locale;
} }
@OneToOne(fetch=FetchType.LAZY) @OneToOne(fetch=FetchType.LAZY)
@JoinColumn(name="user_account_id",nullable=false) @JoinColumn(name=AbstractPetStoreDBColumn.USER_ACCOUNT_ID,nullable=false)
@VascModelReference @VascModelReference
public UserAccount getUserAccount() { public UserAccount getUserAccount() {
return userAccount; return userAccount;
} }
public void setUserAccount(UserAccount userAccount) { public void setUserAccount(UserAccount userAccount) {
this.userAccount = userAccount; this.userAccount = userAccount;
} }
@OneToOne(fetch=FetchType.LAZY) @OneToOne(fetch=FetchType.LAZY)
@JoinColumn(name="user_category_id",nullable=false) @JoinColumn(name=AbstractPetStoreDBColumn.USER_CATEGORY_ID,nullable=false)
@VascModelReference @VascModelReference
public Category getUserCategory() { public Category getUserCategory() {
return userCategory; return userCategory;
} }
public void setUserCategory(Category userCategory) { public void setUserCategory(Category userCategory) {
this.userCategory = userCategory; this.userCategory = userCategory;
} }

View file

@ -48,6 +48,7 @@ import net.forwardfire.vasc.demo.tech.domain.menu.model.VascMenuGroup;
import net.forwardfire.vasc.demo.tech.domain.menu.model.VascMenuWeb; import net.forwardfire.vasc.demo.tech.domain.menu.model.VascMenuWeb;
import net.forwardfire.vasc.demo.tech.domain.menu.model.VascMenuWebComparator; import net.forwardfire.vasc.demo.tech.domain.menu.model.VascMenuWebComparator;
import net.forwardfire.vasc.demo.tech.domain.menu.model.VascMenuWebType; import net.forwardfire.vasc.demo.tech.domain.menu.model.VascMenuWebType;
import net.forwardfire.vasc.demo.tech.domain.petstore.model.AbstractPetStoreVascBackend.OrderBackend;
/** /**
* MenuController Shows the menu for the user. * MenuController Shows the menu for the user.
@ -64,6 +65,9 @@ public class VascMenuControllerImpl implements VascMenuControllerLocal,VascMenuC
public VascMenuControllerImpl() { public VascMenuControllerImpl() {
vascMenuWebComparator = new VascMenuWebComparator(); vascMenuWebComparator = new VascMenuWebComparator();
OrderBackend ob = null;
} }
public List<VascMenuWeb> fetchVascMenuWeb() { public List<VascMenuWeb> fetchVascMenuWeb() {

View file

@ -174,6 +174,8 @@ public class VascExportServlet extends HttpServlet {
VascEntryLocal ve = (VascEntryLocal)vc.getVascEntryConfigController().configVascEntry(vc, entryId); VascEntryLocal ve = (VascEntryLocal)vc.getVascEntryConfigController().configVascEntry(vc, entryId);
vc.getVascEntryConfigController().configVascFrontendController(vc, ve); vc.getVascEntryConfigController().configVascFrontendController(vc, ve);
ve.getVascFrontendController().getVascFrontendActions().refreshData();
VascEntryExport ex = vc.getVascEntryConfigController().getVascEntryExporterById(exportId); VascEntryExport ex = vc.getVascEntryConfigController().getVascEntryExporterById(exportId);
VascEntryExportWriter exw = ex.createExportWriter(); VascEntryExportWriter exw = ex.createExportWriter();
exw.doInit(ex, ve); exw.doInit(ex, ve);