From e643a69308e6bbfb7971c412a76cefc9172b722b Mon Sep 17 00:00:00 2001 From: Willem Cazander Date: Mon, 25 Aug 2014 22:27:59 +0200 Subject: [PATCH] removed some magic from jpa. --- .../forwardfire/vasc/backend/VascBackend.java | 1 - .../demo/server/core/VascTechDemoStartup.java | 4 +- .../demo/server/ui/ServerGuiApplication.java | 13 +++--- .../model/AbstractPetStoreEntity.java | 22 +++++++++- ...=> AbstractPetStoreVascFieldTemplate.java} | 41 +++++++++---------- .../tech/domain/petstore/model/Category.java | 23 ++++------- .../petstore/model/CategoryProduct.java | 20 +++------ .../demo/tech/domain/petstore/model/Item.java | 19 +++------ .../domain/petstore/model/ItemInventory.java | 15 ++----- .../domain/petstore/model/ItemSupplier.java | 17 ++------ .../tech/domain/petstore/model/Order.java | 36 ++++++++-------- .../tech/domain/petstore/model/OrderLine.java | 34 +++++++-------- .../domain/petstore/model/OrderStatus.java | 25 +++++------ .../domain/petstore/model/UserAccount.java | 25 +++++------ .../domain/petstore/model/UserCredential.java | 21 +++------- .../domain/petstore/model/UserProfile.java | 41 ++++++++----------- .../tech/ejb3/VascMenuControllerImpl.java | 4 ++ .../web/export/VascExportServlet.java | 2 + 18 files changed, 157 insertions(+), 206 deletions(-) rename vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/{AbstractPetStoreFieldTemplates.java => AbstractPetStoreVascFieldTemplate.java} (68%) diff --git a/vasc-backend/vasc-backend-api/src/main/java/net/forwardfire/vasc/backend/VascBackend.java b/vasc-backend/vasc-backend-api/src/main/java/net/forwardfire/vasc/backend/VascBackend.java index 9719f58..c39f231 100644 --- a/vasc-backend/vasc-backend-api/src/main/java/net/forwardfire/vasc/backend/VascBackend.java +++ b/vasc-backend/vasc-backend-api/src/main/java/net/forwardfire/vasc/backend/VascBackend.java @@ -90,7 +90,6 @@ public interface VascBackend { long doRecordMoveUpById(VascBackendState state,Object primaryId) throws VascBackendException; long doRecordMoveDownById(VascBackendState state,Object primaryId) throws VascBackendException; - boolean hasPageSummary(); boolean hasTotalSummary(); diff --git a/vasc-demo/vasc-demo-server/src/main/java/net/forwardfire/vasc/demo/server/core/VascTechDemoStartup.java b/vasc-demo/vasc-demo-server/src/main/java/net/forwardfire/vasc/demo/server/core/VascTechDemoStartup.java index 0e4b7e0..fe3085f 100644 --- a/vasc-demo/vasc-demo-server/src/main/java/net/forwardfire/vasc/demo/server/core/VascTechDemoStartup.java +++ b/vasc-demo/vasc-demo-server/src/main/java/net/forwardfire/vasc/demo/server/core/VascTechDemoStartup.java @@ -232,9 +232,11 @@ public enum VascTechDemoStartup { serverConfigService.stop(); tomcatService.stop(); databaseService.stop(); - swingGuiService.stop(); + long stopTime = System.currentTimeMillis(); logger.info("VascTechDemo shutdown in "+(stopTime-startTime)+" ms."); + + swingGuiService.stop();// fixme kills logging } catch (Exception e) { e.printStackTrace(); System.exit(1); diff --git a/vasc-demo/vasc-demo-server/src/main/java/net/forwardfire/vasc/demo/server/ui/ServerGuiApplication.java b/vasc-demo/vasc-demo-server/src/main/java/net/forwardfire/vasc/demo/server/ui/ServerGuiApplication.java index 0c682b9..3f543fe 100644 --- a/vasc-demo/vasc-demo-server/src/main/java/net/forwardfire/vasc/demo/server/ui/ServerGuiApplication.java +++ b/vasc-demo/vasc-demo-server/src/main/java/net/forwardfire/vasc/demo/server/ui/ServerGuiApplication.java @@ -115,13 +115,13 @@ public class ServerGuiApplication extends SingleFrameApplication { updateInfoTask.run=false; // app will exit so stop update return true; } else { - logger.finer("Closing application window."); + logger.info("Closing application window."); updateInfoTask.doUpdate=false; // close window ServerGuiApplication.getInstance().getMainFrame().setVisible(false); return false; } } - + @Override public void willExit(EventObject event) { } @@ -150,7 +150,7 @@ public class ServerGuiApplication extends SingleFrameApplication { static public ServerGuiApplication getInstance() { return getInstance(ServerGuiApplication.class); } - + private void startSystemTray() { if (!SystemTray.isSupported()) { return; @@ -158,7 +158,7 @@ public class ServerGuiApplication extends SingleFrameApplication { 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 SystemTray tray = SystemTray.getSystemTray(); - + MenuItem aboutItem = new MenuItem("About"); aboutItem.addActionListener(new ActionListener() { @Override @@ -185,7 +185,6 @@ public class ServerGuiApplication extends SingleFrameApplication { } }); - popup.add(exitItem); popup.addSeparator(); popup.add(aboutItem); @@ -196,7 +195,7 @@ public class ServerGuiApplication extends SingleFrameApplication { try { tray.add(trayIcon); } 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("TitledBorder.font", Font.decode("SansSerif-BOLD-16")); UIManager.put("FireDial.font", Font.decode("SansSerif-9")); - + String colorName = "laf-colors"; ClassLoader cl = Thread.currentThread().getContextClassLoader(); if (cl==null) { diff --git a/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/AbstractPetStoreEntity.java b/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/AbstractPetStoreEntity.java index a6a6f89..d350e39 100644 --- a/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/AbstractPetStoreEntity.java +++ b/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/AbstractPetStoreEntity.java @@ -1,5 +1,25 @@ 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; + } } diff --git a/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/AbstractPetStoreFieldTemplates.java b/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/AbstractPetStoreVascFieldTemplate.java similarity index 68% rename from vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/AbstractPetStoreFieldTemplates.java rename to vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/AbstractPetStoreVascFieldTemplate.java index 0eef643..44e48cb 100644 --- a/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/AbstractPetStoreFieldTemplates.java +++ b/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/AbstractPetStoreVascFieldTemplate.java @@ -15,40 +15,39 @@ import net.forwardfire.vasc.validators.VascObjectNotNull; import net.forwardfire.vasc.validators.VascStringLength; -abstract public class AbstractPetStoreFieldTemplates { - +abstract public class AbstractPetStoreVascFieldTemplate { /** * Template for field ids. */ @VascPrimaryKey - @VascI18n(name="generic.id.labelText",description="generic.id.toolTipText") - @VascStyle(sizeList=50) - @VascField(create=false,editReadOnly=true) - @VascFieldOrder(order=0) - abstract public Integer getId(); - + @VascI18n(name="generic.id.labelText",description="generic.id.toolTipText") + @VascStyle(sizeList=50) + @VascField(create=false,editReadOnly=true) + @VascFieldOrder(order=0) + abstract public Long getId(); + /** * Template for field names. */ @VascDisplayName - @VascI18n(name="generic.name.labelText",description="generic.name.toolTipText") - @VascObjectNotNull - @VascStringLength(min=4,max=128) - @VascStyle(sizeList=250,sizeEdit=40) - @VascFieldOrder(order=1) + @VascI18n(name="generic.name.labelText",description="generic.name.toolTipText") + @VascObjectNotNull + @VascStringLength(min=4,max=128) + @VascStyle(sizeList=250,sizeEdit=40) + @VascFieldOrder(order=1) abstract public String getName(); - + /** * Template for description field names. */ - @VascI18n(name="generic.description.labelText",description="generic.description.toolTipText") - @VascFieldType(type="TextAreaField",properties={"editor.columns=40","editor.rows=5"}) - @VascDefaultValue(value="") - @VascField(list=false) - @VascStringLength(max=4096) - @VascObjectNotNull - @VascFieldOrder(order=2) + @VascI18n(name="generic.description.labelText",description="generic.description.toolTipText") + @VascFieldType(type="TextAreaField",properties={"editor.columns=40","editor.rows=5"}) + @VascDefaultValue(value="") + @VascField(list=false) + @VascStringLength(max=4096) + @VascObjectNotNull + @VascFieldOrder(order=2) abstract public String getDescription(); /** diff --git a/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/Category.java b/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/Category.java index 771ba6c..bfe28d2 100644 --- a/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/Category.java +++ b/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/Category.java @@ -2,45 +2,35 @@ package net.forwardfire.vasc.demo.tech.domain.petstore.model; import javax.persistence.Column; import javax.persistence.Entity; -import javax.persistence.Id; import javax.persistence.Table; import net.forwardfire.vasc.annotations.VascField; import net.forwardfire.vasc.annotations.VascFieldTemplate; @Entity -@Table(name="category",schema="petstore") -public class Category extends AbstractPetStoreEntity{ +@Table(name=AbstractPetStoreDBTable.CATEGORY,schema=AbstractPetStoreDBCatalog.SCHEMA) +public class Category extends AbstractPetStoreEntity { - private Integer id = null; private String name = null; private String description = 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) - @VascFieldTemplate(templateClass=AbstractPetStoreFieldTemplates.class) + @VascFieldTemplate(templateClass=AbstractPetStoreVascFieldTemplate.class) public String getName() { return name; } + public void setName(String name) { this.name = name; } @Column(name="description",nullable=false) - @VascFieldTemplate(templateClass=AbstractPetStoreFieldTemplates.class) + @VascFieldTemplate(templateClass=AbstractPetStoreVascFieldTemplate.class) public String getDescription() { return description; } + public void setDescription(String description) { this.description = description; } @@ -50,6 +40,7 @@ public class Category extends AbstractPetStoreEntity{ public String getIconUrl() { return iconUrl; } + public void setIconUrl(String iconUrl) { this.iconUrl = iconUrl; } diff --git a/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/CategoryProduct.java b/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/CategoryProduct.java index 0adff2b..285f73d 100644 --- a/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/CategoryProduct.java +++ b/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/CategoryProduct.java @@ -3,33 +3,23 @@ package net.forwardfire.vasc.demo.tech.domain.petstore.model; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; -import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.OneToOne; +import javax.persistence.Table; import net.forwardfire.vasc.annotations.VascField; import net.forwardfire.vasc.annotations.VascFieldTemplate; import net.forwardfire.vasc.annotations.VascModelReference; @Entity +@Table(name=AbstractPetStoreDBTable.CATEGORY_PRODUCT,schema=AbstractPetStoreDBCatalog.SCHEMA) public class CategoryProduct extends AbstractPetStoreEntity { - - private Integer id = null; + private Category category = null; private String name = null; private String description = 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) @JoinColumn(name="category_id",nullable=false) @VascModelReference @@ -41,7 +31,7 @@ public class CategoryProduct extends AbstractPetStoreEntity { } @Column(name="name",nullable=false) - @VascFieldTemplate(templateClass=AbstractPetStoreFieldTemplates.class) + @VascFieldTemplate(templateClass=AbstractPetStoreVascFieldTemplate.class) public String getName() { return name; } @@ -50,7 +40,7 @@ public class CategoryProduct extends AbstractPetStoreEntity { } @Column(name="description",nullable=false) - @VascFieldTemplate(templateClass=AbstractPetStoreFieldTemplates.class) + @VascFieldTemplate(templateClass=AbstractPetStoreVascFieldTemplate.class) public String getDescription() { return description; } diff --git a/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/Item.java b/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/Item.java index 03efb54..baebd15 100644 --- a/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/Item.java +++ b/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/Item.java @@ -6,14 +6,15 @@ import javax.persistence.FetchType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.OneToOne; +import javax.persistence.Table; import net.forwardfire.vasc.annotations.VascFieldTemplate; import net.forwardfire.vasc.annotations.VascModelReference; @Entity +@Table(name=AbstractPetStoreDBTable.ITEM,schema=AbstractPetStoreDBCatalog.SCHEMA) public class Item extends AbstractPetStoreEntity { - - private Integer id = null; + private CategoryProduct categoryProduct = null; private ItemSupplier itemSupplier = null; private Float price = null; @@ -21,16 +22,6 @@ public class Item extends AbstractPetStoreEntity { private String name = 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) @JoinColumn(name="category_product_id",nullable=false) @VascModelReference @@ -69,7 +60,7 @@ public class Item extends AbstractPetStoreEntity { @Column(name="name",nullable=false) - @VascFieldTemplate(templateClass=AbstractPetStoreFieldTemplates.class) + @VascFieldTemplate(templateClass=AbstractPetStoreVascFieldTemplate.class) public String getName() { return name; } @@ -79,7 +70,7 @@ public class Item extends AbstractPetStoreEntity { @Column(name="description",nullable=false) - @VascFieldTemplate(templateClass=AbstractPetStoreFieldTemplates.class) + @VascFieldTemplate(templateClass=AbstractPetStoreVascFieldTemplate.class) public String getDescription() { return description; } diff --git a/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/ItemInventory.java b/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/ItemInventory.java index 6c0da79..822e68d 100644 --- a/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/ItemInventory.java +++ b/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/ItemInventory.java @@ -6,27 +6,18 @@ import javax.persistence.FetchType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.OneToOne; +import javax.persistence.Table; import net.forwardfire.vasc.annotations.VascFieldTemplate; import net.forwardfire.vasc.annotations.VascModelReference; @Entity +@Table(name=AbstractPetStoreDBTable.ITEM_INVENTORY,schema=AbstractPetStoreDBCatalog.SCHEMA) public class ItemInventory extends AbstractPetStoreEntity { - - private Integer id = null; + private Item item = 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) @JoinColumn(name="item_id",nullable=false) @VascModelReference diff --git a/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/ItemSupplier.java b/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/ItemSupplier.java index ab0da4f..a798cac 100644 --- a/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/ItemSupplier.java +++ b/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/ItemSupplier.java @@ -3,30 +3,21 @@ package net.forwardfire.vasc.demo.tech.domain.petstore.model; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; +import javax.persistence.Table; import net.forwardfire.vasc.annotations.VascField; import net.forwardfire.vasc.annotations.VascFieldTemplate; @Entity +@Table(name=AbstractPetStoreDBTable.ITEM_SUPPLIER,schema=AbstractPetStoreDBCatalog.SCHEMA) public class ItemSupplier extends AbstractPetStoreEntity { - private Integer id = null; private String name = null; private String description = 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) - @VascFieldTemplate(templateClass=AbstractPetStoreFieldTemplates.class) + @VascFieldTemplate(templateClass=AbstractPetStoreVascFieldTemplate.class) public String getName() { return name; } @@ -35,7 +26,7 @@ public class ItemSupplier extends AbstractPetStoreEntity { } @Column(name="description",nullable=false) - @VascFieldTemplate(templateClass=AbstractPetStoreFieldTemplates.class) + @VascFieldTemplate(templateClass=AbstractPetStoreVascFieldTemplate.class) public String getDescription() { return description; } diff --git a/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/Order.java b/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/Order.java index 2462815..e75002d 100644 --- a/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/Order.java +++ b/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/Order.java @@ -5,18 +5,17 @@ import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; -import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.OneToOne; +import javax.persistence.Table; import net.forwardfire.vasc.annotations.VascField; -import net.forwardfire.vasc.annotations.VascFieldTemplate; import net.forwardfire.vasc.annotations.VascModelReference; @Entity +@Table(name=AbstractPetStoreDBTable.ORDER,schema=AbstractPetStoreDBCatalog.SCHEMA) public class Order extends AbstractPetStoreEntity { - - private Integer id = null; + private UserAccount userAccount = null; private Date orderDate = null; private Date shipDate = null; @@ -33,22 +32,13 @@ public class Order extends AbstractPetStoreEntity { private String billZipCode = null; private String billCountry = 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) - @JoinColumn(name="user_account_id",nullable=false) - @VascModelReference + @OneToOne(fetch=FetchType.LAZY) + @JoinColumn(name="user_account_id",nullable=false) + @VascModelReference public UserAccount getUserAccount() { return userAccount; } + public void setUserAccount(UserAccount userAccount) { this.userAccount = userAccount; } @@ -57,6 +47,7 @@ public class Order extends AbstractPetStoreEntity { public Date getOrderDate() { return orderDate; } + public void setOrderDate(Date orderDate) { this.orderDate = orderDate; } @@ -66,6 +57,7 @@ public class Order extends AbstractPetStoreEntity { public Date getShipDate() { return shipDate; } + public void setShipDate(Date shipDate) { this.shipDate = shipDate; } @@ -75,6 +67,7 @@ public class Order extends AbstractPetStoreEntity { public String getShipAddr1() { return shipAddr1; } + public void setShipAddr1(String shipAddr1) { this.shipAddr1 = shipAddr1; } @@ -84,6 +77,7 @@ public class Order extends AbstractPetStoreEntity { public String getShipAddr2() { return shipAddr2; } + public void setShipAddr2(String shipAddr2) { this.shipAddr2 = shipAddr2; } @@ -93,6 +87,7 @@ public class Order extends AbstractPetStoreEntity { public String getShipCity() { return shipCity; } + public void setShipCity(String shipCity) { this.shipCity = shipCity; } @@ -102,6 +97,7 @@ public class Order extends AbstractPetStoreEntity { public String getShipZipCode() { return shipZipCode; } + public void setShipZipCode(String shipZipCode) { this.shipZipCode = shipZipCode; } @@ -111,6 +107,7 @@ public class Order extends AbstractPetStoreEntity { public String getShipCountry() { return shipCountry; } + public void setShipCountry(String shipCountry) { this.shipCountry = shipCountry; } @@ -120,6 +117,7 @@ public class Order extends AbstractPetStoreEntity { public String getBillAddr1() { return billAddr1; } + public void setBillAddr1(String billAddr1) { this.billAddr1 = billAddr1; } @@ -129,6 +127,7 @@ public class Order extends AbstractPetStoreEntity { public String getBillAddr2() { return billAddr2; } + public void setBillAddr2(String billAddr2) { this.billAddr2 = billAddr2; } @@ -138,6 +137,7 @@ public class Order extends AbstractPetStoreEntity { public String getBillCity() { return billCity; } + public void setBillCity(String billCity) { this.billCity = billCity; } @@ -147,6 +147,7 @@ public class Order extends AbstractPetStoreEntity { public String getBillZipCode() { return billZipCode; } + public void setBillZipCode(String billZipCode) { this.billZipCode = billZipCode; } @@ -156,6 +157,7 @@ public class Order extends AbstractPetStoreEntity { public String getBillCountry() { return billCountry; } + public void setBillCountry(String billCountry) { this.billCountry = billCountry; } diff --git a/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/OrderLine.java b/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/OrderLine.java index 2e122e4..8d79d54 100644 --- a/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/OrderLine.java +++ b/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/OrderLine.java @@ -3,40 +3,30 @@ package net.forwardfire.vasc.demo.tech.domain.petstore.model; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; -import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.OneToOne; +import javax.persistence.Table; import net.forwardfire.vasc.annotations.VascField; -import net.forwardfire.vasc.annotations.VascFieldTemplate; import net.forwardfire.vasc.annotations.VascModelReference; @Entity +@Table(name=AbstractPetStoreDBTable.ORDER_LINE,schema=AbstractPetStoreDBCatalog.SCHEMA) public class OrderLine extends AbstractPetStoreEntity { - - private Integer id = null; + private Order order = null; private Integer lineNumber = null; private Item item = null; private Integer quantity = null; private Float itemPrice = 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) - @JoinColumn(name="order_id",nullable=false) - @VascModelReference + @OneToOne(fetch=FetchType.LAZY) + @JoinColumn(name="order_id",nullable=false) + @VascModelReference public Order getOrder() { return order; } + public void setOrder(Order order) { this.order = order; } @@ -46,16 +36,18 @@ public class OrderLine extends AbstractPetStoreEntity { public Integer getLineNumber() { return lineNumber; } + public void setLineNumber(Integer lineNumber) { this.lineNumber = lineNumber; } - @OneToOne(fetch=FetchType.LAZY) - @JoinColumn(name="item_id",nullable=false) - @VascModelReference + @OneToOne(fetch=FetchType.LAZY) + @JoinColumn(name="item_id",nullable=false) + @VascModelReference public Item getItem() { return item; } + public void setItem(Item item) { this.item = item; } @@ -64,6 +56,7 @@ public class OrderLine extends AbstractPetStoreEntity { public Integer getQuantity() { return quantity; } + public void setQuantity(Integer quantity) { this.quantity = quantity; } @@ -72,6 +65,7 @@ public class OrderLine extends AbstractPetStoreEntity { public Float getItemPrice() { return itemPrice; } + public void setItemPrice(Float itemPrice) { this.itemPrice = itemPrice; } diff --git a/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/OrderStatus.java b/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/OrderStatus.java index 93ecbfa..b811048 100644 --- a/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/OrderStatus.java +++ b/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/OrderStatus.java @@ -3,61 +3,56 @@ package net.forwardfire.vasc.demo.tech.domain.petstore.model; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Id; +import javax.persistence.Table; import net.forwardfire.vasc.annotations.VascField; import net.forwardfire.vasc.annotations.VascFieldTemplate; @Entity +@Table(name=AbstractPetStoreDBTable.ORDER_STATUS,schema=AbstractPetStoreDBCatalog.SCHEMA) public class OrderStatus extends AbstractPetStoreEntity { - - private Integer id = null; + private String type = null; private Boolean active = null; private String name = 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) public String getType() { return type; } + public void setType(String type) { this.type = type; } @Column(name="active",nullable=false) - @VascFieldTemplate(templateClass=AbstractPetStoreFieldTemplates.class) + @VascFieldTemplate(templateClass=AbstractPetStoreVascFieldTemplate.class) public Boolean getActive() { return active; } + public void setActive(Boolean active) { this.active = active; } @Column(name="name",nullable=false) - @VascFieldTemplate(templateClass=AbstractPetStoreFieldTemplates.class) + @VascFieldTemplate(templateClass=AbstractPetStoreVascFieldTemplate.class) public String getName() { return name; } + public void setName(String name) { this.name = name; } @Column(name="description",nullable=false) @VascField(list=false) - @VascFieldTemplate(templateClass=AbstractPetStoreFieldTemplates.class) + @VascFieldTemplate(templateClass=AbstractPetStoreVascFieldTemplate.class) public String getDescription() { return description; } + public void setDescription(String description) { this.description = description; } diff --git a/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/UserAccount.java b/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/UserAccount.java index 1834683..899b846 100644 --- a/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/UserAccount.java +++ b/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/UserAccount.java @@ -2,15 +2,14 @@ package net.forwardfire.vasc.demo.tech.domain.petstore.model; import javax.persistence.Column; import javax.persistence.Entity; -import javax.persistence.Id; +import javax.persistence.Table; import net.forwardfire.vasc.annotations.VascField; -import net.forwardfire.vasc.annotations.VascFieldTemplate; @Entity +@Table(name=AbstractPetStoreDBTable.USER_ACCOUNT,schema=AbstractPetStoreDBCatalog.SCHEMA) public class UserAccount extends AbstractPetStoreEntity { - - private Integer id = null; + private String email = null; private String firstName = null; private String lastName = null; @@ -20,20 +19,11 @@ public class UserAccount extends AbstractPetStoreEntity { private String country = 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) public String getEmail() { return email; } + public void setEmail(String email) { this.email = email; } @@ -43,6 +33,7 @@ public class UserAccount extends AbstractPetStoreEntity { public String getFirstName() { return firstName; } + public void setFirstName(String firstName) { this.firstName = firstName; } @@ -52,6 +43,7 @@ public class UserAccount extends AbstractPetStoreEntity { public String getLastName() { return lastName; } + public void setLastName(String lastName) { this.lastName = lastName; } @@ -61,6 +53,7 @@ public class UserAccount extends AbstractPetStoreEntity { public String getStreetName() { return streetName; } + public void setStreetName(String streetName) { this.streetName = streetName; } @@ -70,6 +63,7 @@ public class UserAccount extends AbstractPetStoreEntity { public String getStreetNumber() { return streetNumber; } + public void setStreetNumber(String streetNumber) { this.streetNumber = streetNumber; } @@ -79,6 +73,7 @@ public class UserAccount extends AbstractPetStoreEntity { public String getZipCode() { return zipCode; } + public void setZipCode(String zipCode) { this.zipCode = zipCode; } @@ -87,6 +82,7 @@ public class UserAccount extends AbstractPetStoreEntity { public String getCountry() { return country; } + public void setCountry(String country) { this.country = country; } @@ -96,6 +92,7 @@ public class UserAccount extends AbstractPetStoreEntity { public String getCountryState() { return countryState; } + public void setCountryState(String countryState) { this.countryState = countryState; } diff --git a/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/UserCredential.java b/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/UserCredential.java index 49b185d..2826980 100644 --- a/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/UserCredential.java +++ b/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/UserCredential.java @@ -3,18 +3,17 @@ package net.forwardfire.vasc.demo.tech.domain.petstore.model; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; -import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.OneToOne; +import javax.persistence.Table; import net.forwardfire.vasc.annotations.VascField; -import net.forwardfire.vasc.annotations.VascFieldTemplate; import net.forwardfire.vasc.annotations.VascModelReference; @Entity +@Table(name=AbstractPetStoreDBTable.USER_CREDENTIAL,schema=AbstractPetStoreDBCatalog.SCHEMA) public class UserCredential extends AbstractPetStoreEntity { - private Integer id = null; private UserAccount userAccount = null; private String password = null; private String secretQuestion0 = null; @@ -22,19 +21,9 @@ public class UserCredential extends AbstractPetStoreEntity { private String secretQuestion1 = null; private String secretAnswer1 = 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) - @JoinColumn(name="user_account_id",nullable=false) - @VascModelReference + @OneToOne(fetch=FetchType.LAZY) + @JoinColumn(name="user_account_id",nullable=false) + @VascModelReference public UserAccount getUserAccount() { return userAccount; } diff --git a/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/UserProfile.java b/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/UserProfile.java index 14f6240..c8908c9 100644 --- a/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/UserProfile.java +++ b/vasc-demo/vasc-demo-tech-domain/src/main/java/net/forwardfire/vasc/demo/tech/domain/petstore/model/UserProfile.java @@ -3,81 +3,76 @@ package net.forwardfire.vasc.demo.tech.domain.petstore.model; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.FetchType; -import javax.persistence.Id; + import javax.persistence.JoinColumn; import javax.persistence.OneToOne; +import javax.persistence.Table; import net.forwardfire.vasc.annotations.VascDefaultValue; import net.forwardfire.vasc.annotations.VascField; -import net.forwardfire.vasc.annotations.VascFieldTemplate; import net.forwardfire.vasc.annotations.VascModelReference; @Entity +@Table(name=AbstractPetStoreDBTable.USER_PROFILE,schema=AbstractPetStoreDBCatalog.SCHEMA) public class UserProfile extends AbstractPetStoreEntity { - - private Integer id = null; + private String signUpIp = null; private String signUpAgent = null; private String locale = null; private UserAccount userAccount = null; private Category userCategory = 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="signup_ip",nullable=false) + @Column(name=AbstractPetStoreDBColumn.SIGNUP_IP,nullable=false) @VascField(list=false) @VascDefaultValue(value="0.0.0.0") public String getSignUpIp() { return signUpIp; } + public void setSignUpIp(String signUpIp) { this.signUpIp = signUpIp; } - @Column(name="signup_agent",nullable=false) + @Column(name=AbstractPetStoreDBColumn.SIGNUP_AGENT,nullable=false) @VascField(list=false) @VascDefaultValue(value="No-Agent") public String getSignUpAgent() { return signUpAgent; } + public void setSignUpAgent(String signUpAgent) { this.signUpAgent = signUpAgent; } - @Column(name="locale",nullable=false) + @Column(name=AbstractPetStoreDBColumn.LOCALE,nullable=false) @VascField(list=false) @VascDefaultValue(value="nl_NL") public String getLocale() { return locale; } + public void setLocale(String locale) { this.locale = locale; } - @OneToOne(fetch=FetchType.LAZY) - @JoinColumn(name="user_account_id",nullable=false) - @VascModelReference + @OneToOne(fetch=FetchType.LAZY) + @JoinColumn(name=AbstractPetStoreDBColumn.USER_ACCOUNT_ID,nullable=false) + @VascModelReference public UserAccount getUserAccount() { return userAccount; } + public void setUserAccount(UserAccount userAccount) { this.userAccount = userAccount; } - @OneToOne(fetch=FetchType.LAZY) - @JoinColumn(name="user_category_id",nullable=false) - @VascModelReference + @OneToOne(fetch=FetchType.LAZY) + @JoinColumn(name=AbstractPetStoreDBColumn.USER_CATEGORY_ID,nullable=false) + @VascModelReference public Category getUserCategory() { return userCategory; } + public void setUserCategory(Category userCategory) { this.userCategory = userCategory; } diff --git a/vasc-demo/vasc-demo-tech-web/src/main/java/net/forwardfire/vasc/demo/tech/ejb3/VascMenuControllerImpl.java b/vasc-demo/vasc-demo-tech-web/src/main/java/net/forwardfire/vasc/demo/tech/ejb3/VascMenuControllerImpl.java index 73c362e..980125e 100644 --- a/vasc-demo/vasc-demo-tech-web/src/main/java/net/forwardfire/vasc/demo/tech/ejb3/VascMenuControllerImpl.java +++ b/vasc-demo/vasc-demo-tech-web/src/main/java/net/forwardfire/vasc/demo/tech/ejb3/VascMenuControllerImpl.java @@ -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.VascMenuWebComparator; 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. @@ -64,6 +65,9 @@ public class VascMenuControllerImpl implements VascMenuControllerLocal,VascMenuC public VascMenuControllerImpl() { vascMenuWebComparator = new VascMenuWebComparator(); + + + OrderBackend ob = null; } public List fetchVascMenuWeb() { diff --git a/vasc-frontend/vasc-frontend-web-export/src/main/java/net/forwardfire/vasc/frontend/web/export/VascExportServlet.java b/vasc-frontend/vasc-frontend-web-export/src/main/java/net/forwardfire/vasc/frontend/web/export/VascExportServlet.java index c2f80cb..d2f6f3a 100644 --- a/vasc-frontend/vasc-frontend-web-export/src/main/java/net/forwardfire/vasc/frontend/web/export/VascExportServlet.java +++ b/vasc-frontend/vasc-frontend-web-export/src/main/java/net/forwardfire/vasc/frontend/web/export/VascExportServlet.java @@ -174,6 +174,8 @@ public class VascExportServlet extends HttpServlet { VascEntryLocal ve = (VascEntryLocal)vc.getVascEntryConfigController().configVascEntry(vc, entryId); vc.getVascEntryConfigController().configVascFrontendController(vc, ve); + ve.getVascFrontendController().getVascFrontendActions().refreshData(); + VascEntryExport ex = vc.getVascEntryConfigController().getVascEntryExporterById(exportId); VascEntryExportWriter exw = ex.createExportWriter(); exw.doInit(ex, ve);