diff --git a/demo-petstore/.classpath b/demo-petstore/.classpath new file mode 100644 index 0000000..f42fb64 --- /dev/null +++ b/demo-petstore/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/demo-petstore/.project b/demo-petstore/.project new file mode 100644 index 0000000..cffb8f9 --- /dev/null +++ b/demo-petstore/.project @@ -0,0 +1,23 @@ + + + demo-petstore + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.maven.ide.eclipse.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.maven.ide.eclipse.maven2Nature + + diff --git a/demo-petstore/.settings/org.eclipse.jdt.core.prefs b/demo-petstore/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..e42f9f9 --- /dev/null +++ b/demo-petstore/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,6 @@ +#Mon Mar 21 21:21:31 CET 2011 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.5 diff --git a/demo-petstore/.settings/org.maven.ide.eclipse.prefs b/demo-petstore/.settings/org.maven.ide.eclipse.prefs new file mode 100644 index 0000000..99fa036 --- /dev/null +++ b/demo-petstore/.settings/org.maven.ide.eclipse.prefs @@ -0,0 +1,9 @@ +#Mon Mar 21 21:21:31 CET 2011 +activeProfiles= +eclipse.preferences.version=1 +fullBuildGoals=process-test-resources +includeModules=false +resolveWorkspaceProjects=true +resourceFilterGoals=process-resources resources\:testResources +skipCompilerPlugin=true +version=1 diff --git a/demo-petstore/demo-petstore-ear/.classpath b/demo-petstore/demo-petstore-ear/.classpath new file mode 100644 index 0000000..f42fb64 --- /dev/null +++ b/demo-petstore/demo-petstore-ear/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/demo-petstore/demo-petstore-ear/.project b/demo-petstore/demo-petstore-ear/.project new file mode 100644 index 0000000..b15ca09 --- /dev/null +++ b/demo-petstore/demo-petstore-ear/.project @@ -0,0 +1,23 @@ + + + demo-petstore-ear + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.maven.ide.eclipse.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.maven.ide.eclipse.maven2Nature + + diff --git a/demo-petstore/demo-petstore-ear/.settings/org.eclipse.jdt.core.prefs b/demo-petstore/demo-petstore-ear/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..01efec6 --- /dev/null +++ b/demo-petstore/demo-petstore-ear/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,6 @@ +#Mon Mar 21 21:23:56 CET 2011 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.5 diff --git a/demo-petstore/demo-petstore-ear/.settings/org.maven.ide.eclipse.prefs b/demo-petstore/demo-petstore-ear/.settings/org.maven.ide.eclipse.prefs new file mode 100644 index 0000000..77be0cd --- /dev/null +++ b/demo-petstore/demo-petstore-ear/.settings/org.maven.ide.eclipse.prefs @@ -0,0 +1,9 @@ +#Mon Mar 21 21:23:56 CET 2011 +activeProfiles= +eclipse.preferences.version=1 +fullBuildGoals=process-test-resources +includeModules=false +resolveWorkspaceProjects=true +resourceFilterGoals=process-resources resources\:testResources +skipCompilerPlugin=true +version=1 diff --git a/demo-petstore/demo-petstore-ear/pom.xml b/demo-petstore/demo-petstore-ear/pom.xml new file mode 100644 index 0000000..c9ddc4a --- /dev/null +++ b/demo-petstore/demo-petstore-ear/pom.xml @@ -0,0 +1,11 @@ + + 4.0.0 + + demo-petstore + com.idcanet.vasc + 0.3.5-SNAPSHOT + + com.idcanet.vasc + demo-petstore-ear + 0.3.5-SNAPSHOT + \ No newline at end of file diff --git a/demo-petstore/demo-petstore-ejb/.classpath b/demo-petstore/demo-petstore-ejb/.classpath new file mode 100644 index 0000000..f42fb64 --- /dev/null +++ b/demo-petstore/demo-petstore-ejb/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/demo-petstore/demo-petstore-ejb/.project b/demo-petstore/demo-petstore-ejb/.project new file mode 100644 index 0000000..361ebfb --- /dev/null +++ b/demo-petstore/demo-petstore-ejb/.project @@ -0,0 +1,23 @@ + + + demo-petstore-ejb + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.maven.ide.eclipse.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.maven.ide.eclipse.maven2Nature + + diff --git a/demo-petstore/demo-petstore-ejb/.settings/org.eclipse.jdt.core.prefs b/demo-petstore/demo-petstore-ejb/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..18b6a3b --- /dev/null +++ b/demo-petstore/demo-petstore-ejb/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,6 @@ +#Mon Mar 21 21:23:08 CET 2011 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.5 diff --git a/demo-petstore/demo-petstore-ejb/.settings/org.maven.ide.eclipse.prefs b/demo-petstore/demo-petstore-ejb/.settings/org.maven.ide.eclipse.prefs new file mode 100644 index 0000000..9eb6d86 --- /dev/null +++ b/demo-petstore/demo-petstore-ejb/.settings/org.maven.ide.eclipse.prefs @@ -0,0 +1,9 @@ +#Mon Mar 21 21:23:08 CET 2011 +activeProfiles= +eclipse.preferences.version=1 +fullBuildGoals=process-test-resources +includeModules=false +resolveWorkspaceProjects=true +resourceFilterGoals=process-resources resources\:testResources +skipCompilerPlugin=true +version=1 diff --git a/demo-petstore/demo-petstore-ejb/pom.xml b/demo-petstore/demo-petstore-ejb/pom.xml new file mode 100644 index 0000000..15ab11e --- /dev/null +++ b/demo-petstore/demo-petstore-ejb/pom.xml @@ -0,0 +1,89 @@ + + 4.0.0 + + demo-petstore + com.idcanet.vasc + 0.3.5-SNAPSHOT + + com.idcanet.vasc + demo-petstore-ejb + 0.3.5-SNAPSHOT + ejb + demo-petstore-ejb + demo-petstore-ejb + + + + org.apache.maven.plugins + maven-ejb-plugin + ${maven-ejb-plugin.version} + + 3.0 + + + + + + + com.idcanet.vasc + vasc-core + ${project.version} + + + javax.el + el-api + ${el-api.version} + + + javax.ejb + ejb-api + ${ejb-api.version} + provided + + + javax.persistence + persistence-api + ${persistence-api.version} + provided + + + org.hibernate + hibernate-annotations + ${hibernate-annotations.version} + provided + + + com.idcanet.x4o + x4o-core + ${x4o-core.version} + provided + + + com.idcanet.vasc + vasc-core + ${project.version} + provided + + + com.idcanet.vasc + vasc-backend-jpa + ${project.version} + provided + + + com.idcanet.vasc + vasc-xpql + ${project.version} + + + com.idcanet.vasc + vasc-xpql-ejb3 + ${project.version} + + + com.idcanet.vasc + vasc-ejb3 + ${project.version} + + + \ No newline at end of file diff --git a/demo-petstore/demo-petstore-ejb/src/main/java/demo/petstore/models/AbstractPetStoreEntity.java b/demo-petstore/demo-petstore-ejb/src/main/java/demo/petstore/models/AbstractPetStoreEntity.java new file mode 100644 index 0000000..a507619 --- /dev/null +++ b/demo-petstore/demo-petstore-ejb/src/main/java/demo/petstore/models/AbstractPetStoreEntity.java @@ -0,0 +1,5 @@ +package demo.petstore.models; + +abstract public class AbstractPetStoreEntity { + +} diff --git a/demo-petstore/demo-petstore-ejb/src/main/java/demo/petstore/models/AbstractPetStoreFieldTemplates.java b/demo-petstore/demo-petstore-ejb/src/main/java/demo/petstore/models/AbstractPetStoreFieldTemplates.java new file mode 100644 index 0000000..a85e760 --- /dev/null +++ b/demo-petstore/demo-petstore-ejb/src/main/java/demo/petstore/models/AbstractPetStoreFieldTemplates.java @@ -0,0 +1,79 @@ +package demo.petstore.models; + +import java.util.Date; + +import com.idcanet.vasc.annotations.VascDefaultValue; +import com.idcanet.vasc.annotations.VascDisplayName; +import com.idcanet.vasc.annotations.VascField; +import com.idcanet.vasc.annotations.VascFieldOrder; +import com.idcanet.vasc.annotations.VascFieldType; +import com.idcanet.vasc.annotations.VascI18n; +import com.idcanet.vasc.annotations.VascPrimaryKey; +import com.idcanet.vasc.annotations.VascRoles; +import com.idcanet.vasc.annotations.VascStyle; +import com.idcanet.vasc.validators.VascObjectNotNull; +import com.idcanet.vasc.validators.VascStringLength; + +abstract public class AbstractPetStoreFieldTemplates { + + + /** + * Template for field ids. + */ + @VascPrimaryKey + @VascI18n(name="generic.id.labelText",description="generic.id.toolTipText") + @VascStyle(sizeList=50) + @VascField(create=false,editReadOnly=true) + @VascFieldOrder(orderIndex=0) + abstract public Integer 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(orderIndex=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(orderIndex=2) + abstract public String getDescription(); + + /** + * Template for active field. + */ + @VascI18n(name="generic.active.labelText",description="generic.active.toolTipText") + @VascDefaultValue(value="true") + @VascObjectNotNull + @VascFieldOrder(orderIndex=4) + @VascField(create=false) + @VascRoles(rolesEdit="datafeedsPowerRole",rolesList="datafeedsPowerRole") + abstract public Boolean getActive(); + + /** + * Template for modified date. + */ + @VascI18n(name="generic.modifiedDate.labelText",description="generic.modifiedDate.toolTipText") + @VascField(create=false,editReadOnly=true,list=false) + @VascObjectNotNull + abstract public Date getModifiedDate(); + + /** + * Template for created date. + */ + @VascI18n(name="generic.createdDate.labelText",description="generic.createdDate.toolTipText") + @VascField(create=false,editReadOnly=true,list=false) + @VascObjectNotNull + abstract public Date getCreatedDate(); +} diff --git a/demo-petstore/demo-petstore-ejb/src/main/java/demo/petstore/models/Category.java b/demo-petstore/demo-petstore-ejb/src/main/java/demo/petstore/models/Category.java new file mode 100644 index 0000000..6ad587c --- /dev/null +++ b/demo-petstore/demo-petstore-ejb/src/main/java/demo/petstore/models/Category.java @@ -0,0 +1,54 @@ +package demo.petstore.models; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; + +import com.idcanet.vasc.annotations.VascField; +import com.idcanet.vasc.annotations.VascFieldTemplate; + +@Entity +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) + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + @Column(name="description",nullable=false) + @VascFieldTemplate(templateClass=AbstractPetStoreFieldTemplates.class) + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } + + @Column(name="icon_url",nullable=true) + @VascField(list=false) + public String getIconUrl() { + return iconUrl; + } + public void setIconUrl(String iconUrl) { + this.iconUrl = iconUrl; + } +} diff --git a/demo-petstore/demo-petstore-ejb/src/main/java/demo/petstore/models/CategoryProduct.java b/demo-petstore/demo-petstore-ejb/src/main/java/demo/petstore/models/CategoryProduct.java new file mode 100644 index 0000000..235b1d2 --- /dev/null +++ b/demo-petstore/demo-petstore-ejb/src/main/java/demo/petstore/models/CategoryProduct.java @@ -0,0 +1,69 @@ +package demo.petstore.models; + +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 com.idcanet.vasc.annotations.VascField; +import com.idcanet.vasc.annotations.VascFieldTemplate; +import com.idcanet.vasc.annotations.VascModelReference; + +@Entity +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 + public Category getCategory() { + return category; + } + public void setCategory(Category category) { + this.category = category; + } + + @Column(name="name",nullable=false) + @VascFieldTemplate(templateClass=AbstractPetStoreFieldTemplates.class) + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + @Column(name="description",nullable=false) + @VascFieldTemplate(templateClass=AbstractPetStoreFieldTemplates.class) + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } + + @Column(name="icon_url",nullable=true) + @VascField(list=false) + public String getIconUrl() { + return iconUrl; + } + public void setIconUrl(String iconUrl) { + this.iconUrl = iconUrl; + } +} diff --git a/demo-petstore/demo-petstore-ejb/src/main/java/demo/petstore/models/Item.java b/demo-petstore/demo-petstore-ejb/src/main/java/demo/petstore/models/Item.java new file mode 100644 index 0000000..c378687 --- /dev/null +++ b/demo-petstore/demo-petstore-ejb/src/main/java/demo/petstore/models/Item.java @@ -0,0 +1,89 @@ +package demo.petstore.models; + +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 com.idcanet.vasc.annotations.VascFieldTemplate; +import com.idcanet.vasc.annotations.VascModelReference; + +@Entity +public class Item extends AbstractPetStoreEntity { + + private Integer id = null; + private CategoryProduct categoryProduct = null; + private ItemSupplier itemSupplier = null; + private Float price = null; + private Integer status = 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; + } + + @OneToOne(fetch=FetchType.LAZY) + @JoinColumn(name="category_product_id",nullable=false) + @VascModelReference + public CategoryProduct getCategoryProduct() { + return categoryProduct; + } + public void setCategoryProduct(CategoryProduct categoryProduct) { + this.categoryProduct = categoryProduct; + } + + @OneToOne(fetch=FetchType.LAZY) + @JoinColumn(name="item_supplier_id",nullable=false) + @VascModelReference + public ItemSupplier getItemSupplier() { + return itemSupplier; + } + public void setItemSupplier(ItemSupplier itemSupplier) { + this.itemSupplier = itemSupplier; + } + + @Column(name="price",nullable=false) + public Float getPrice() { + return price; + } + public void setPrice(Float price) { + this.price = price; + } + + @Column(name="status",nullable=false) + public Integer getStatus() { + return status; + } + public void setStatus(Integer status) { + this.status = status; + } + + + @Column(name="name",nullable=false) + @VascFieldTemplate(templateClass=AbstractPetStoreFieldTemplates.class) + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + + @Column(name="description",nullable=false) + @VascFieldTemplate(templateClass=AbstractPetStoreFieldTemplates.class) + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } +} diff --git a/demo-petstore/demo-petstore-ejb/src/main/java/demo/petstore/models/ItemInventory.java b/demo-petstore/demo-petstore-ejb/src/main/java/demo/petstore/models/ItemInventory.java new file mode 100644 index 0000000..bb0556b --- /dev/null +++ b/demo-petstore/demo-petstore-ejb/src/main/java/demo/petstore/models/ItemInventory.java @@ -0,0 +1,47 @@ +package demo.petstore.models; + +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 com.idcanet.vasc.annotations.VascFieldTemplate; +import com.idcanet.vasc.annotations.VascModelReference; + +@Entity +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 + public Item getItem() { + return item; + } + public void setItem(Item item) { + this.item = item; + } + + @Column(name="inventory_count",nullable=false) + public Integer getInventoryCount() { + return inventoryCount; + } + public void setInventoryCount(Integer inventoryCount) { + this.inventoryCount = inventoryCount; + } +} diff --git a/demo-petstore/demo-petstore-ejb/src/main/java/demo/petstore/models/ItemSupplier.java b/demo-petstore/demo-petstore-ejb/src/main/java/demo/petstore/models/ItemSupplier.java new file mode 100644 index 0000000..3e31e96 --- /dev/null +++ b/demo-petstore/demo-petstore-ejb/src/main/java/demo/petstore/models/ItemSupplier.java @@ -0,0 +1,54 @@ +package demo.petstore.models; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; + +import com.idcanet.vasc.annotations.VascField; +import com.idcanet.vasc.annotations.VascFieldTemplate; + +@Entity +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) + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + + @Column(name="description",nullable=false) + @VascFieldTemplate(templateClass=AbstractPetStoreFieldTemplates.class) + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } + + @Column(name="website",nullable=false) + @VascField(list=false) + public String getWebsite() { + return website; + } + public void setWebsite(String website) { + this.website = website; + } +} diff --git a/demo-petstore/demo-petstore-ejb/src/main/java/demo/petstore/models/Order.java b/demo-petstore/demo-petstore-ejb/src/main/java/demo/petstore/models/Order.java new file mode 100644 index 0000000..eed19b2 --- /dev/null +++ b/demo-petstore/demo-petstore-ejb/src/main/java/demo/petstore/models/Order.java @@ -0,0 +1,162 @@ +package demo.petstore.models; + +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 com.idcanet.vasc.annotations.VascField; +import com.idcanet.vasc.annotations.VascFieldTemplate; +import com.idcanet.vasc.annotations.VascModelReference; + +@Entity +public class Order extends AbstractPetStoreEntity { + + private Integer id = null; + private UserAccount userAccount = null; + private Date orderDate = null; + private Date shipDate = null; + + private String shipAddr1 = null; + private String shipAddr2 = null; + private String shipCity = null; + private String shipZipCode = null; + private String shipCountry = null; + + private String billAddr1 = null; + private String billAddr2 = null; + private String billCity = null; + 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 + public UserAccount getUserAccount() { + return userAccount; + } + public void setUserAccount(UserAccount userAccount) { + this.userAccount = userAccount; + } + + @Column(name="order_date",nullable=false) + public Date getOrderDate() { + return orderDate; + } + public void setOrderDate(Date orderDate) { + this.orderDate = orderDate; + } + + @Column(name="ship_date",nullable=false) + @VascField(list=false) + public Date getShipDate() { + return shipDate; + } + public void setShipDate(Date shipDate) { + this.shipDate = shipDate; + } + + @Column(name="ship_addr1",nullable=false) + @VascField(list=false) + public String getShipAddr1() { + return shipAddr1; + } + public void setShipAddr1(String shipAddr1) { + this.shipAddr1 = shipAddr1; + } + + @Column(name="ship_addr2",nullable=false) + @VascField(list=false) + public String getShipAddr2() { + return shipAddr2; + } + public void setShipAddr2(String shipAddr2) { + this.shipAddr2 = shipAddr2; + } + + @Column(name="ship_city",nullable=false) + @VascField(list=false) + public String getShipCity() { + return shipCity; + } + public void setShipCity(String shipCity) { + this.shipCity = shipCity; + } + + @Column(name="ship_zipcode",nullable=false) + @VascField(list=false) + public String getShipZipCode() { + return shipZipCode; + } + public void setShipZipCode(String shipZipCode) { + this.shipZipCode = shipZipCode; + } + + @Column(name="ship_country",nullable=false) + @VascField(list=false) + public String getShipCountry() { + return shipCountry; + } + public void setShipCountry(String shipCountry) { + this.shipCountry = shipCountry; + } + + @Column(name="bill_addr1",nullable=false) + @VascField(list=false) + public String getBillAddr1() { + return billAddr1; + } + public void setBillAddr1(String billAddr1) { + this.billAddr1 = billAddr1; + } + + @Column(name="bill_addr2",nullable=false) + @VascField(list=false) + public String getBillAddr2() { + return billAddr2; + } + public void setBillAddr2(String billAddr2) { + this.billAddr2 = billAddr2; + } + + @Column(name="bill_city",nullable=false) + @VascField(list=false) + public String getBillCity() { + return billCity; + } + public void setBillCity(String billCity) { + this.billCity = billCity; + } + + @Column(name="bill_zipcode",nullable=false) + @VascField(list=false) + public String getBillZipCode() { + return billZipCode; + } + public void setBillZipCode(String billZipCode) { + this.billZipCode = billZipCode; + } + + @Column(name="bill_country",nullable=false) + @VascField(list=false) + public String getBillCountry() { + return billCountry; + } + public void setBillCountry(String billCountry) { + this.billCountry = billCountry; + } +} diff --git a/demo-petstore/demo-petstore-ejb/src/main/java/demo/petstore/models/OrderLine.java b/demo-petstore/demo-petstore-ejb/src/main/java/demo/petstore/models/OrderLine.java new file mode 100644 index 0000000..11874fb --- /dev/null +++ b/demo-petstore/demo-petstore-ejb/src/main/java/demo/petstore/models/OrderLine.java @@ -0,0 +1,78 @@ +package demo.petstore.models; + +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 com.idcanet.vasc.annotations.VascField; +import com.idcanet.vasc.annotations.VascFieldTemplate; +import com.idcanet.vasc.annotations.VascModelReference; + +@Entity +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 + public Order getOrder() { + return order; + } + public void setOrder(Order order) { + this.order = order; + } + + @Column(name="line_number",nullable=false) + @VascField(list=false) + public Integer getLineNumber() { + return lineNumber; + } + public void setLineNumber(Integer lineNumber) { + this.lineNumber = lineNumber; + } + + @OneToOne(fetch=FetchType.LAZY) + @JoinColumn(name="item_id",nullable=false) + @VascModelReference + public Item getItem() { + return item; + } + public void setItem(Item item) { + this.item = item; + } + + @Column(name="quantity",nullable=false) + public Integer getQuantity() { + return quantity; + } + public void setQuantity(Integer quantity) { + this.quantity = quantity; + } + + @Column(name="item_price",nullable=false) + public Float getItemPrice() { + return itemPrice; + } + public void setItemPrice(Float itemPrice) { + this.itemPrice = itemPrice; + } +} diff --git a/demo-petstore/demo-petstore-ejb/src/main/java/demo/petstore/models/OrderStatus.java b/demo-petstore/demo-petstore-ejb/src/main/java/demo/petstore/models/OrderStatus.java new file mode 100644 index 0000000..75a3f02 --- /dev/null +++ b/demo-petstore/demo-petstore-ejb/src/main/java/demo/petstore/models/OrderStatus.java @@ -0,0 +1,64 @@ +package demo.petstore.models; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; + +import com.idcanet.vasc.annotations.VascField; +import com.idcanet.vasc.annotations.VascFieldTemplate; + +@Entity +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) + public Boolean getActive() { + return active; + } + public void setActive(Boolean active) { + this.active = active; + } + + @Column(name="name",nullable=false) + @VascFieldTemplate(templateClass=AbstractPetStoreFieldTemplates.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) + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } +} diff --git a/demo-petstore/demo-petstore-ejb/src/main/java/demo/petstore/models/UserAccount.java b/demo-petstore/demo-petstore-ejb/src/main/java/demo/petstore/models/UserAccount.java new file mode 100644 index 0000000..8e19435 --- /dev/null +++ b/demo-petstore/demo-petstore-ejb/src/main/java/demo/petstore/models/UserAccount.java @@ -0,0 +1,102 @@ +package demo.petstore.models; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.Id; + +import com.idcanet.vasc.annotations.VascField; +import com.idcanet.vasc.annotations.VascFieldTemplate; + +@Entity +public class UserAccount extends AbstractPetStoreEntity { + + private Integer id = null; + private String email = null; + private String firstName = null; + private String lastName = null; + private String streetName = null; + private String streetNumber = null; + private String zipCode = null; + 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; + } + + @Column(name="first_name",nullable=false) + @VascField(list=false) + public String getFirstName() { + return firstName; + } + public void setFirstName(String firstName) { + this.firstName = firstName; + } + + @Column(name="last_name",nullable=false) + @VascField(list=false) + public String getLastName() { + return lastName; + } + public void setLastName(String lastName) { + this.lastName = lastName; + } + + @Column(name="street_name",nullable=false) + @VascField(list=false) + public String getStreetName() { + return streetName; + } + public void setStreetName(String streetName) { + this.streetName = streetName; + } + + @Column(name="street_number",nullable=false) + @VascField(list=false) + public String getStreetNumber() { + return streetNumber; + } + public void setStreetNumber(String streetNumber) { + this.streetNumber = streetNumber; + } + + @Column(name="zip_code",nullable=false) + @VascField(list=false) + public String getZipCode() { + return zipCode; + } + public void setZipCode(String zipCode) { + this.zipCode = zipCode; + } + + @Column(name="country",nullable=false) + public String getCountry() { + return country; + } + public void setCountry(String country) { + this.country = country; + } + + @Column(name="country_state",nullable=false) + @VascField(list=false) + public String getCountryState() { + return countryState; + } + public void setCountryState(String countryState) { + this.countryState = countryState; + } +} diff --git a/demo-petstore/demo-petstore-ejb/src/main/java/demo/petstore/models/UserCredential.java b/demo-petstore/demo-petstore-ejb/src/main/java/demo/petstore/models/UserCredential.java new file mode 100644 index 0000000..3467875 --- /dev/null +++ b/demo-petstore/demo-petstore-ejb/src/main/java/demo/petstore/models/UserCredential.java @@ -0,0 +1,89 @@ +package demo.petstore.models; + +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 com.idcanet.vasc.annotations.VascField; +import com.idcanet.vasc.annotations.VascFieldTemplate; +import com.idcanet.vasc.annotations.VascModelReference; + +@Entity +public class UserCredential extends AbstractPetStoreEntity { + + private Integer id = null; + private UserAccount userAccount = null; + private String password = null; + private String secretQuestion0 = null; + private String secretAnswer0 = null; + 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 + public UserAccount getUserAccount() { + return userAccount; + } + public void setUserAccount(UserAccount userAccount) { + this.userAccount = userAccount; + } + + @Column(name="password",nullable=false) + @VascField(list=false) + public String getPassword() { + return password; + } + public void setPassword(String password) { + this.password = password; + } + + @Column(name="secret_question0",nullable=false) + @VascField(list=false) + public String getSecretQuestion0() { + return secretQuestion0; + } + public void setSecretQuestion0(String secretQuestion0) { + this.secretQuestion0 = secretQuestion0; + } + + @Column(name="secret_answer0",nullable=false) + @VascField(list=false) + public String getSecretAnswer0() { + return secretAnswer0; + } + public void setSecretAnswer0(String secretAnswer0) { + this.secretAnswer0 = secretAnswer0; + } + + @Column(name="secret_question1",nullable=false) + @VascField(list=false) + public String getSecretQuestion1() { + return secretQuestion1; + } + public void setSecretQuestion1(String secretQuestion1) { + this.secretQuestion1 = secretQuestion1; + } + + @Column(name="secret_answer1",nullable=false) + @VascField(list=false) + public String getSecretAnswer1() { + return secretAnswer1; + } + public void setSecretAnswer1(String secretAnswer1) { + this.secretAnswer1 = secretAnswer1; + } +} diff --git a/demo-petstore/demo-petstore-ejb/src/main/java/demo/petstore/models/UserProfile.java b/demo-petstore/demo-petstore-ejb/src/main/java/demo/petstore/models/UserProfile.java new file mode 100644 index 0000000..3759423 --- /dev/null +++ b/demo-petstore/demo-petstore-ejb/src/main/java/demo/petstore/models/UserProfile.java @@ -0,0 +1,84 @@ +package demo.petstore.models; + +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 com.idcanet.vasc.annotations.VascDefaultValue; +import com.idcanet.vasc.annotations.VascField; +import com.idcanet.vasc.annotations.VascFieldTemplate; +import com.idcanet.vasc.annotations.VascModelReference; + +@Entity +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) + @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) + @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) + @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 + 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 + public Category getUserCategory() { + return userCategory; + } + public void setUserCategory(Category userCategory) { + this.userCategory = userCategory; + } +} diff --git a/demo-petstore/demo-petstore-ejb/src/main/resources/META-INF/persistence.xml b/demo-petstore/demo-petstore-ejb/src/main/resources/META-INF/persistence.xml new file mode 100644 index 0000000..4e8d526 --- /dev/null +++ b/demo-petstore/demo-petstore-ejb/src/main/resources/META-INF/persistence.xml @@ -0,0 +1,35 @@ + + + + + + java:demo_petstore_dba + + demo.petstore.models.Category + demo.petstore.models.CategoryProduct + demo.petstore.models.Item + demo.petstore.models.ItemInventory + demo.petstore.models.ItemSupplier + demo.petstore.models.Order + demo.petstore.models.OrderLine + demo.petstore.models.OrderStatus + demo.petstore.models.UserAccount + demo.petstore.models.UserCredential + demo.petstore.models.UserProfile + + + + + + + + + + + + + + \ No newline at end of file diff --git a/demo-petstore/demo-petstore-ejb/src/main/resources/META-INF/vasc-ejb3.xml b/demo-petstore/demo-petstore-ejb/src/main/resources/META-INF/vasc-ejb3.xml new file mode 100644 index 0000000..5a6558c --- /dev/null +++ b/demo-petstore/demo-petstore-ejb/src/main/resources/META-INF/vasc-ejb3.xml @@ -0,0 +1,11 @@ + + + + + Files to load + + java:/df_ui_datafeeds_pu + df-ui/ejb/xpqlQueryManager/local + demo/petstore/resources/i18n/PetstoreBundle_en + demo/petstore/resources/vasc/petstore.xml + \ No newline at end of file diff --git a/demo-petstore/demo-petstore-ejb/src/main/resources/META-INF/xtes-xpql-ejb3.xml b/demo-petstore/demo-petstore-ejb/src/main/resources/META-INF/xtes-xpql-ejb3.xml new file mode 100644 index 0000000..90fa488 --- /dev/null +++ b/demo-petstore/demo-petstore-ejb/src/main/resources/META-INF/xtes-xpql-ejb3.xml @@ -0,0 +1,9 @@ + + + + + Files to load + + java:/petstore_pu + demo/petstore/resources/xpql/petstore.xml + \ No newline at end of file diff --git a/demo-petstore/demo-petstore-ejb/src/main/resources/demo/petstore/resources/vasc/petstore.xml b/demo-petstore/demo-petstore-ejb/src/main/resources/demo/petstore/resources/vasc/petstore.xml new file mode 100644 index 0000000..e69de29 diff --git a/demo-petstore/demo-petstore-ejb/src/main/resources/demo/petstore/resources/xpql/petstore.xml b/demo-petstore/demo-petstore-ejb/src/main/resources/demo/petstore/resources/xpql/petstore.xml new file mode 100644 index 0000000..e69de29 diff --git a/demo-petstore/demo-petstore-war/.classpath b/demo-petstore/demo-petstore-war/.classpath new file mode 100644 index 0000000..f42fb64 --- /dev/null +++ b/demo-petstore/demo-petstore-war/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/demo-petstore/demo-petstore-war/.project b/demo-petstore/demo-petstore-war/.project new file mode 100644 index 0000000..0e18434 --- /dev/null +++ b/demo-petstore/demo-petstore-war/.project @@ -0,0 +1,23 @@ + + + demo-petstore-war + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.maven.ide.eclipse.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.maven.ide.eclipse.maven2Nature + + diff --git a/demo-petstore/demo-petstore-war/.settings/org.eclipse.jdt.core.prefs b/demo-petstore/demo-petstore-war/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..c8854a4 --- /dev/null +++ b/demo-petstore/demo-petstore-war/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,6 @@ +#Mon Mar 21 21:23:30 CET 2011 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.5 diff --git a/demo-petstore/demo-petstore-war/.settings/org.maven.ide.eclipse.prefs b/demo-petstore/demo-petstore-war/.settings/org.maven.ide.eclipse.prefs new file mode 100644 index 0000000..bda79c9 --- /dev/null +++ b/demo-petstore/demo-petstore-war/.settings/org.maven.ide.eclipse.prefs @@ -0,0 +1,9 @@ +#Mon Mar 21 21:23:30 CET 2011 +activeProfiles= +eclipse.preferences.version=1 +fullBuildGoals=process-test-resources +includeModules=false +resolveWorkspaceProjects=true +resourceFilterGoals=process-resources resources\:testResources +skipCompilerPlugin=true +version=1 diff --git a/demo-petstore/demo-petstore-war/pom.xml b/demo-petstore/demo-petstore-war/pom.xml new file mode 100644 index 0000000..89f545c --- /dev/null +++ b/demo-petstore/demo-petstore-war/pom.xml @@ -0,0 +1,11 @@ + + 4.0.0 + + demo-petstore + com.idcanet.vasc + 0.3.5-SNAPSHOT + + com.idcanet.vasc + demo-petstore-war + 0.3.5-SNAPSHOT + \ No newline at end of file diff --git a/demo-petstore/pom.xml b/demo-petstore/pom.xml new file mode 100644 index 0000000..f609bb2 --- /dev/null +++ b/demo-petstore/pom.xml @@ -0,0 +1,19 @@ + + 4.0.0 + + vasc-base + com.idcanet.vasc + 0.3.5-SNAPSHOT + + com.idcanet.vasc + demo-petstore + 0.3.5-SNAPSHOT + pom + demo-petstore + demo-petstore + + demo-petstore-ejb + demo-petstore-war + demo-petstore-ear + + \ No newline at end of file diff --git a/vasc-ejb3/.settings/org.eclipse.core.resources.prefs b/vasc-ejb3/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..657c1b9 --- /dev/null +++ b/vasc-ejb3/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,7 @@ +#Sat Dec 24 00:45:43 CET 2011 +eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding//src/main/resources=UTF-8 +encoding//src/test/java=UTF-8 +encoding//src/test/resources=UTF-8 +encoding/=UTF-8