2
0
Fork 0

Commited non-commited files of demo code

This commit is contained in:
willem.cazander 2011-12-24 20:52:05 +01:00
parent 2464e7a917
commit 3d6ceff732
39 changed files with 1360 additions and 0 deletions

10
demo-petstore/.classpath Normal file
View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>

23
demo-petstore/.project Normal file
View file

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>demo-petstore</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.maven.ide.eclipse.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.maven.ide.eclipse.maven2Nature</nature>
</natures>
</projectDescription>

View file

@ -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

View file

@ -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

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>

View file

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>demo-petstore-ear</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.maven.ide.eclipse.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.maven.ide.eclipse.maven2Nature</nature>
</natures>
</projectDescription>

View file

@ -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

View file

@ -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

View file

@ -0,0 +1,11 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>demo-petstore</artifactId>
<groupId>com.idcanet.vasc</groupId>
<version>0.3.5-SNAPSHOT</version>
</parent>
<groupId>com.idcanet.vasc</groupId>
<artifactId>demo-petstore-ear</artifactId>
<version>0.3.5-SNAPSHOT</version>
</project>

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>

View file

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>demo-petstore-ejb</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.maven.ide.eclipse.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.maven.ide.eclipse.maven2Nature</nature>
</natures>
</projectDescription>

View file

@ -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

View file

@ -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

View file

@ -0,0 +1,89 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>demo-petstore</artifactId>
<groupId>com.idcanet.vasc</groupId>
<version>0.3.5-SNAPSHOT</version>
</parent>
<groupId>com.idcanet.vasc</groupId>
<artifactId>demo-petstore-ejb</artifactId>
<version>0.3.5-SNAPSHOT</version>
<packaging>ejb</packaging>
<name>demo-petstore-ejb</name>
<description>demo-petstore-ejb</description>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ejb-plugin</artifactId>
<version>${maven-ejb-plugin.version}</version>
<configuration>
<ejbVersion>3.0</ejbVersion>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>com.idcanet.vasc</groupId>
<artifactId>vasc-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>javax.el</groupId>
<artifactId>el-api</artifactId>
<version>${el-api.version}</version>
</dependency>
<dependency>
<groupId>javax.ejb</groupId>
<artifactId>ejb-api</artifactId>
<version>${ejb-api.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>persistence-api</artifactId>
<version>${persistence-api.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-annotations</artifactId>
<version>${hibernate-annotations.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.idcanet.x4o</groupId>
<artifactId>x4o-core</artifactId>
<version>${x4o-core.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.idcanet.vasc</groupId>
<artifactId>vasc-core</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.idcanet.vasc</groupId>
<artifactId>vasc-backend-jpa</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.idcanet.vasc</groupId>
<artifactId>vasc-xpql</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.idcanet.vasc</groupId>
<artifactId>vasc-xpql-ejb3</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.idcanet.vasc</groupId>
<artifactId>vasc-ejb3</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>

View file

@ -0,0 +1,5 @@
package demo.petstore.models;
abstract public class AbstractPetStoreEntity {
}

View file

@ -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();
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -0,0 +1,35 @@
<?xml version="1.0"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">
<persistence-unit name="petstore_pu" transaction-type="JTA" >
<jta-data-source>java:demo_petstore_dba</jta-data-source>
<class>demo.petstore.models.Category</class>
<class>demo.petstore.models.CategoryProduct</class>
<class>demo.petstore.models.Item</class>
<class>demo.petstore.models.ItemInventory</class>
<class>demo.petstore.models.ItemSupplier</class>
<class>demo.petstore.models.Order</class>
<class>demo.petstore.models.OrderLine</class>
<class>demo.petstore.models.OrderStatus</class>
<class>demo.petstore.models.UserAccount</class>
<class>demo.petstore.models.UserCredential</class>
<class>demo.petstore.models.UserProfile</class>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
<property name="hibernate.max_fetch_depth" value="3"/>
<!-- Print SQL to stdout. -->
<property name="hibernate.show_sql" value="false"/>
<property name="hibernate.format_sql" value="true"/>
</properties>
</persistence-unit>
</persistence>

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<comment>
Files to load
</comment>
<entry key="persistenceUnit">java:/df_ui_datafeeds_pu</entry>
<entry key="xpqlController">df-ui/ejb/xpqlQueryManager/local</entry>
<entry key="i18nBundle">demo/petstore/resources/i18n/PetstoreBundle_en</entry>
<entry key="load.0">demo/petstore/resources/vasc/petstore.xml</entry>
</properties>

View file

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<comment>
Files to load
</comment>
<entry key="persistenceUnit">java:/petstore_pu</entry>
<entry key="load.0">demo/petstore/resources/xpql/petstore.xml</entry>
</properties>

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java"/>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>

View file

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>demo-petstore-war</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.maven.ide.eclipse.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.maven.ide.eclipse.maven2Nature</nature>
</natures>
</projectDescription>

View file

@ -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

View file

@ -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

View file

@ -0,0 +1,11 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>demo-petstore</artifactId>
<groupId>com.idcanet.vasc</groupId>
<version>0.3.5-SNAPSHOT</version>
</parent>
<groupId>com.idcanet.vasc</groupId>
<artifactId>demo-petstore-war</artifactId>
<version>0.3.5-SNAPSHOT</version>
</project>

19
demo-petstore/pom.xml Normal file
View file

@ -0,0 +1,19 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>vasc-base</artifactId>
<groupId>com.idcanet.vasc</groupId>
<version>0.3.5-SNAPSHOT</version>
</parent>
<groupId>com.idcanet.vasc</groupId>
<artifactId>demo-petstore</artifactId>
<version>0.3.5-SNAPSHOT</version>
<packaging>pom</packaging>
<name>demo-petstore</name>
<description>demo-petstore</description>
<modules>
<module>demo-petstore-ejb</module>
<module>demo-petstore-war</module>
<module>demo-petstore-ear</module>
</modules>
</project>

View file

@ -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/<project>=UTF-8