You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@olingo.apache.org by sk...@apache.org on 2014/01/14 12:27:53 UTC
[01/12] git commit: [OLINGO-56] - Enhance the Data Model and the mock
data for the reference scenario.
Updated Branches:
refs/heads/olingo-117 3c327f2fb -> 0848b5448
[OLINGO-56] - Enhance the Data Model and the mock data for the reference
scenario.
Signed-off-by: Chandan V A <ch...@sap.com>
Project: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/commit/fa108dca
Tree: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/tree/fa108dca
Diff: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/diff/fa108dca
Branch: refs/heads/olingo-117
Commit: fa108dca88d8df65986e7ee5256da5e37ea44b88
Parents: 10af698
Author: Chandan V A <ch...@sap.com>
Authored: Sat Jan 11 20:55:27 2014 +0530
Committer: Stephan Klevenz <sk...@apache.org>
Committed: Tue Jan 14 12:24:42 2014 +0100
----------------------------------------------------------------------
.../odata2/jpa/processor/ref/model/Address.java | 11 +++
.../jpa/processor/ref/model/Category.java | 68 ++++++++++++++++
.../jpa/processor/ref/model/Customer.java | 80 ++++++++++++++++++
.../jpa/processor/ref/model/Material.java | 22 ++++-
.../processor/ref/model/SalesOrderHeader.java | 86 ++++++++------------
.../src/main/resources/META-INF/persistence.xml | 2 +
.../extension/SalesOrderHeaderProcessor.java | 2 +-
.../extension/_SalesOrderHeaderProcessor.java | 2 +-
.../jpa/processor/ref/util/DataGenerator.java | 4 +-
.../main/resources/DataDeleteSQLs.properties | 22 -----
.../src/main/resources/MaterialSQLs.properties | 30 -------
.../src/main/resources/NoteSQLs.properties | 20 -----
.../main/resources/SQLInsertConfig.properties | 22 -----
.../src/main/resources/SQL_Cleanup.properties | 22 +++++
.../resources/SQL_Insert_Category.properties | 22 +++++
.../main/resources/SQL_Insert_Config.properties | 22 +++++
.../resources/SQL_Insert_Customer.properties | 23 ++++++
.../resources/SQL_Insert_Material.properties | 30 +++++++
.../main/resources/SQL_Insert_Note.properties | 20 +++++
.../SQL_Insert_SalesOrderHeader.properties | 30 +++++++
.../SQL_Insert_SalesOrderItem.properties | 30 +++++++
.../main/resources/SQL_Insert_Store.properties | 30 +++++++
.../resources/SalesOrderHeaderSQLs.properties | 30 -------
.../resources/SalesOrderItemSQLs.properties | 30 -------
.../src/main/resources/StoreSQLs.properties | 30 -------
25 files changed, 448 insertions(+), 242 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/fa108dca/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Address.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Address.java b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Address.java
index a0aabcb..ab21848 100644
--- a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Address.java
+++ b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Address.java
@@ -48,6 +48,17 @@ public class Address {
@Column(name = "COUNTRY")
private String country;
+
+ @Column(name = "PINCODE")
+ private String pincode;
+
+ public String getPincode() {
+ return pincode;
+ }
+
+ public void setPincode(String pincode) {
+ this.pincode = pincode;
+ }
public short getHouseNumber() {
return houseNumber;
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/fa108dca/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Category.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Category.java b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Category.java
new file mode 100644
index 0000000..34891a7
--- /dev/null
+++ b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Category.java
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+package org.apache.olingo.odata2.jpa.processor.ref.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+
+@Entity
+@Table(name = "T_CATEGORY")
+public class Category {
+
+ @Id
+ @Column(name="CODE")
+ private char code[] = new char[2];
+
+ @Column(name="DESC")
+ private String description;
+
+ @OneToMany(mappedBy = "category")
+ private List<Material> materials = new ArrayList<Material>();
+
+ public List<Material> getMaterials() {
+ return materials;
+ }
+
+ public void setMaterials(List<Material> materials) {
+ this.materials = materials;
+ }
+
+ public char[] getCode() {
+ return code;
+ }
+
+ public void setCode(char[] code) {
+ this.code = code;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/fa108dca/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Customer.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Customer.java b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Customer.java
new file mode 100644
index 0000000..c28e37e
--- /dev/null
+++ b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Customer.java
@@ -0,0 +1,80 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+package org.apache.olingo.odata2.jpa.processor.ref.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.persistence.Column;
+import javax.persistence.Embedded;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.OneToMany;
+import javax.persistence.Table;
+
+@Entity
+@Table(name = "T_CUSTOMER")
+public class Customer {
+
+ @Id
+ @Column(name = "ID")
+ private Long id;
+
+ @Column(name = "NAME")
+ private String name;
+
+ @Embedded
+ private Address address;
+
+ @OneToMany(mappedBy = "customer")
+ private List<SalesOrderHeader> orders = new ArrayList<SalesOrderHeader>();
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public List<SalesOrderHeader> getOrders() {
+ return orders;
+ }
+
+ public void setOrders(List<SalesOrderHeader> orders) {
+ this.orders = orders;
+ }
+
+ public Address getAddress() {
+ return address;
+ }
+
+ public void setAddress(final Address address) {
+ this.address = address;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/fa108dca/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Material.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Material.java b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Material.java
index 6f08119..7330042 100644
--- a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Material.java
+++ b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Material.java
@@ -25,7 +25,9 @@ import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
+import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
+import javax.persistence.ManyToOne;
import javax.persistence.Table;
@Entity
@@ -34,7 +36,7 @@ public class Material {
public Material() {}
- public Material(final String materialName, final String typeCode, final double price,
+ public Material(final String materialName, final char[] typeCode, final double price,
final String measurementUnit) {
super();
this.materialName = materialName;
@@ -51,7 +53,7 @@ public class Material {
private String materialName;
@Column(name = "TYPE_CODE")
- private String typeCode;
+ private char[] typeCode = new char[2];
@Column(name = "PRICE")
private double price;
@@ -62,6 +64,10 @@ public class Material {
@ManyToMany
private List<Store> stores = new ArrayList<Store>();
+ @ManyToOne
+ @JoinColumn(name = "TYPE_CODE", referencedColumnName = "CODE")
+ private Category category;
+
public long getMaterialId() {
return materialId;
}
@@ -70,6 +76,14 @@ public class Material {
this.materialId = materialId;
}
+ public Category getCategory() {
+ return category;
+ }
+
+ public void setCategory(Category category) {
+ this.category = category;
+ }
+
public String getMaterialName() {
return materialName;
}
@@ -78,11 +92,11 @@ public class Material {
this.materialName = materialName;
}
- public String getTypeCode() {
+ public char[] getTypeCode() {
return typeCode;
}
- public void setTypeCode(final String typeCode) {
+ public void setTypeCode(final char[] typeCode) {
this.typeCode = typeCode;
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/fa108dca/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/SalesOrderHeader.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/SalesOrderHeader.java b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/SalesOrderHeader.java
index 9af23f3..3ed1ee5 100644
--- a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/SalesOrderHeader.java
+++ b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/SalesOrderHeader.java
@@ -26,11 +26,11 @@ import java.util.List;
import java.util.Set;
import java.util.TimeZone;
-import javax.persistence.CascadeType;
import javax.persistence.Column;
-import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.PostPersist;
import javax.persistence.Table;
@@ -43,14 +43,10 @@ public class SalesOrderHeader {
public SalesOrderHeader() {}
- public SalesOrderHeader(final Calendar creationDate, final int buyerId, final String buyerName,
- final Address buyerAddress, final String currencyCode, final double netAmount,
+ public SalesOrderHeader(final Calendar creationDate, final String currencyCode, final double netAmount,
final String deliveryStatus, final char[] shortText, final Character[] longText) {
super();
this.creationDate = creationDate;
- this.buyerId = buyerId;
- this.buyerName = buyerName;
- this.buyerAddress = buyerAddress;
this.currencyCode = currencyCode;
this.deliveryStatus = deliveryStatus;
this.shortText = shortText;
@@ -67,29 +63,12 @@ public class SalesOrderHeader {
@Column
private Character status;
- public Character getStatus() {
- return status;
- }
-
- public void setStatus(final Character status) {
- this.status = status;
- }
-
@Column(name = "SHORT_TEXT", length = 20)
private char[] shortText;
@Column(name = "LONG_TEXT", length = 40)
private Character[] longText;
- @Column(name = "BUYER_ID")
- private int buyerId;
-
- @Column(name = "BUYER_NAME", length = 255)
- private String buyerName;
-
- @Embedded
- private Address buyerAddress;
-
@Column(name = "CURRENCY_CODE", length = 3)
private String currencyCode;
@@ -102,12 +81,43 @@ public class SalesOrderHeader {
@Column(precision = 8)
private double netAmount;
- @OneToMany(mappedBy = "salesOrderHeader", cascade = CascadeType.ALL)
+ @Column(name = "CUST_ID")
+ private Long customerId;
+
+ @OneToMany(mappedBy = "salesOrderHeader")
private Set<SalesOrderItem> salesOrderItem = new HashSet<SalesOrderItem>();
- @OneToMany(mappedBy = "salesOrderHeader", cascade = CascadeType.ALL)
+ @OneToMany(mappedBy = "salesOrderHeader")
private List<Note> notes = new ArrayList<Note>();
+ @ManyToOne
+ @JoinColumn(name = "CUST_ID", referencedColumnName = "ID", insertable = false, updatable = false)
+ private Customer customer;
+
+ public Long getCustomerId() {
+ return customerId;
+ }
+
+ public void setCustomerId(Long customerId) {
+ this.customerId = customerId;
+ }
+
+ public Customer getCustomer() {
+ return customer;
+ }
+
+ public void setCustomer(Customer customer) {
+ this.customer = customer;
+ }
+
+ public Character getStatus() {
+ return status;
+ }
+
+ public void setStatus(final Character status) {
+ this.status = status;
+ }
+
public long getSoId() {
return soId;
}
@@ -138,30 +148,6 @@ public class SalesOrderHeader {
this.creationDate = newCalendar;
}
- public int getBuyerId() {
- return buyerId;
- }
-
- public void setBuyerId(final int buyerId) {
- this.buyerId = buyerId;
- }
-
- public String getBuyerName() {
- return buyerName;
- }
-
- public void setBuyerName(final String buyerName) {
- this.buyerName = buyerName;
- }
-
- public Address getBuyerAddress() {
- return buyerAddress;
- }
-
- public void setBuyerAddress(final Address buyerAddress) {
- this.buyerAddress = buyerAddress;
- }
-
public String getCurrencyCode() {
return currencyCode;
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/fa108dca/odata2-jpa-processor/jpa-ref/src/main/resources/META-INF/persistence.xml
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-ref/src/main/resources/META-INF/persistence.xml b/odata2-jpa-processor/jpa-ref/src/main/resources/META-INF/persistence.xml
index e71d834..b5ff286 100644
--- a/odata2-jpa-processor/jpa-ref/src/main/resources/META-INF/persistence.xml
+++ b/odata2-jpa-processor/jpa-ref/src/main/resources/META-INF/persistence.xml
@@ -20,6 +20,8 @@
<class>org.apache.olingo.odata2.jpa.processor.ref.model.Note</class>
<class>org.apache.olingo.odata2.jpa.processor.ref.model.Material</class>
<class>org.apache.olingo.odata2.jpa.processor.ref.model.Store</class>
+ <class>org.apache.olingo.odata2.jpa.processor.ref.model.Category</class>
+ <class>org.apache.olingo.odata2.jpa.processor.ref.model.Customer</class>
<properties>
<property name="javax.persistence.jdbc.driver" value="org.hsqldb.jdbcDriver" />
<property name="javax.persistence.jdbc.url"
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/fa108dca/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/extension/SalesOrderHeaderProcessor.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/extension/SalesOrderHeaderProcessor.java b/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/extension/SalesOrderHeaderProcessor.java
index 57549ee..5dc9017 100644
--- a/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/extension/SalesOrderHeaderProcessor.java
+++ b/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/extension/SalesOrderHeaderProcessor.java
@@ -106,7 +106,7 @@ public class SalesOrderHeaderProcessor {
List<SalesOrderHeader> soList = (List<SalesOrderHeader>) q
.getResultList();
if (!soList.isEmpty()) {
- return soList.get(0).getBuyerAddress();
+ return soList.get(0).getCustomer().getAddress();
} else {
return null;
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/fa108dca/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/extension/_SalesOrderHeaderProcessor.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/extension/_SalesOrderHeaderProcessor.java b/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/extension/_SalesOrderHeaderProcessor.java
index 4bc0a29..bfe0e89 100644
--- a/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/extension/_SalesOrderHeaderProcessor.java
+++ b/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/extension/_SalesOrderHeaderProcessor.java
@@ -108,7 +108,7 @@ public class _SalesOrderHeaderProcessor {
List<SalesOrderHeader> soList = (List<SalesOrderHeader>) q
.getResultList();
if (!soList.isEmpty()) {
- return soList.get(0).getBuyerAddress();
+ return soList.get(0).getCustomer().getAddress();
} else {
return null;
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/fa108dca/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/util/DataGenerator.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/util/DataGenerator.java b/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/util/DataGenerator.java
index 55eb876..e840119 100644
--- a/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/util/DataGenerator.java
+++ b/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/util/DataGenerator.java
@@ -45,14 +45,14 @@ public class DataGenerator {
/**
* This is configuration property to hold comma separated names of Insert Files
*/
- private static final String SQL_INSERT_CONFIG = "SQLInsertConfig";
+ private static final String SQL_INSERT_CONFIG = "SQL_Insert_Config";
/**
* This is key which will be used to fetch file names from SQL Insert Config File.
*/
private static final String SQL_INSERT_FILE_NAMES_KEY = "insert_file_names";
- private static final String SQL_DELETE_CONFIG = "DataDeleteSQLs";
+ private static final String SQL_DELETE_CONFIG = "SQL_Cleanup";
private static final String SQL_DELETE_STATEMENTS_KEY = "delete_queries";
public DataGenerator(final EntityManager entityManager) {
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/fa108dca/odata2-jpa-processor/jpa-web/src/main/resources/DataDeleteSQLs.properties
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-web/src/main/resources/DataDeleteSQLs.properties b/odata2-jpa-processor/jpa-web/src/main/resources/DataDeleteSQLs.properties
deleted file mode 100644
index 19f859d..0000000
--- a/odata2-jpa-processor/jpa-web/src/main/resources/DataDeleteSQLs.properties
+++ /dev/null
@@ -1,22 +0,0 @@
-#-------------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#-------------------------------------------------------------------------------
-
-#Config file for deleting the entities. They are deleted in the order provided in the below comma-separated string.
-#It is mandatory due to referential constaints.
-delete_queries = DELETE FROM T_NOTE,DELETE FROM T_SALESORDERITEM,DELETE FROM T_MATERIAL_T_STORE,DELETE FROM T_MATERIAL,DELETE FROM T_STORE,DELETE FROM T_SALESORDERHEADER
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/fa108dca/odata2-jpa-processor/jpa-web/src/main/resources/MaterialSQLs.properties
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-web/src/main/resources/MaterialSQLs.properties b/odata2-jpa-processor/jpa-web/src/main/resources/MaterialSQLs.properties
deleted file mode 100644
index 0faf9ce..0000000
--- a/odata2-jpa-processor/jpa-web/src/main/resources/MaterialSQLs.properties
+++ /dev/null
@@ -1,30 +0,0 @@
-#-------------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#-------------------------------------------------------------------------------
-
-material_query_1 = insert into T_MATERIAL (MATERIAL_ID , MATERIAL_NAME, TYPE_CODE, PRICE, MEASUREMENT_UNIT) values(111, 'Test_Material_Name_1', 'Test_Type_Code_1', 111.1, 'Dollar');
-material_query_2 = insert into T_MATERIAL (MATERIAL_ID , MATERIAL_NAME, TYPE_CODE, PRICE, MEASUREMENT_UNIT) values(112, 'Test_Material_Name_2', 'Test_Type_Code_2', 112.1, 'Pound');
-material_query_3 = insert into T_MATERIAL (MATERIAL_ID , MATERIAL_NAME, TYPE_CODE, PRICE, MEASUREMENT_UNIT) values(113, 'Test_Material_Name_3', 'Test_Type_Code_3', 113.1, 'Yen');
-material_query_4 = insert into T_MATERIAL (MATERIAL_ID , MATERIAL_NAME, TYPE_CODE, PRICE, MEASUREMENT_UNIT) values(114, 'Test_Material_Name_4', 'Test_Type_Code_4', 114.1, 'Rupee');
-material_query_5 = insert into T_MATERIAL (MATERIAL_ID , MATERIAL_NAME, TYPE_CODE, PRICE, MEASUREMENT_UNIT) values(115, 'Test_Material_Name_5', 'Test_Type_Code_5', 115.1, 'Dollar');
-material_query_6 = insert into T_MATERIAL (MATERIAL_ID , MATERIAL_NAME, TYPE_CODE, PRICE, MEASUREMENT_UNIT) values(116, 'Test_Material_Name_6', 'Test_Type_Code_6', 116.1, 'Dollar');
-material_query_7 = insert into T_MATERIAL (MATERIAL_ID , MATERIAL_NAME, TYPE_CODE, PRICE, MEASUREMENT_UNIT) values(117, 'Test_Material_Name_7', 'Test_Type_Code_7', 117.1, 'Dollar');
-material_query_8 = insert into T_MATERIAL (MATERIAL_ID , MATERIAL_NAME, TYPE_CODE, PRICE, MEASUREMENT_UNIT) values(118, 'Test_Material_Name_8', 'Test_Type_Code_8', 118.1, 'Dollar');
-material_query_9 = insert into T_MATERIAL (MATERIAL_ID , MATERIAL_NAME, TYPE_CODE, PRICE, MEASUREMENT_UNIT) values(119, 'Test_Material_Name_9', 'Test_Type_Code_9', 119.1, 'Dollar');
-material_query_10 = insert into T_MATERIAL (MATERIAL_ID , MATERIAL_NAME, TYPE_CODE, PRICE, MEASUREMENT_UNIT) values(120, 'Test_Material_Name_10', 'Test_Type_Code_10', 120.1, 'Dollar');
-material_query_11 = insert into T_MATERIAL (MATERIAL_ID , MATERIAL_NAME, TYPE_CODE, PRICE, MEASUREMENT_UNIT) values(121, 'Test_Material_Name_11', 'Test_Type_Code_11', 121.1, 'Dollar');
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/fa108dca/odata2-jpa-processor/jpa-web/src/main/resources/NoteSQLs.properties
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-web/src/main/resources/NoteSQLs.properties b/odata2-jpa-processor/jpa-web/src/main/resources/NoteSQLs.properties
deleted file mode 100644
index 347c37a..0000000
--- a/odata2-jpa-processor/jpa-web/src/main/resources/NoteSQLs.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-#-------------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#-------------------------------------------------------------------------------
-
-note_query_1 = insert into T_NOTE (SO_ID , text, createdBy, creationDate,creationTime) values(2, 'Test_Note_1', 'CreatedBy_1','2013-01-01 00:00:00','00:00:23');
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/fa108dca/odata2-jpa-processor/jpa-web/src/main/resources/SQLInsertConfig.properties
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-web/src/main/resources/SQLInsertConfig.properties b/odata2-jpa-processor/jpa-web/src/main/resources/SQLInsertConfig.properties
deleted file mode 100644
index 915a8e8..0000000
--- a/odata2-jpa-processor/jpa-web/src/main/resources/SQLInsertConfig.properties
+++ /dev/null
@@ -1,22 +0,0 @@
-#-------------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#-------------------------------------------------------------------------------
-
-#This file contains names of file which will contain the SQL statements to be executed by Data generator. Add a file name here and it will be picked up by Generator
-#You need to put the file names in order you want to get them called. First Entry will be inserted first.
-insert_file_names = SalesOrderHeaderSQLs,StoreSQLs,MaterialSQLs,SalesOrderItemSQLs,NoteSQLs
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/fa108dca/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Cleanup.properties
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Cleanup.properties b/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Cleanup.properties
new file mode 100644
index 0000000..19f859d
--- /dev/null
+++ b/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Cleanup.properties
@@ -0,0 +1,22 @@
+#-------------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#-------------------------------------------------------------------------------
+
+#Config file for deleting the entities. They are deleted in the order provided in the below comma-separated string.
+#It is mandatory due to referential constaints.
+delete_queries = DELETE FROM T_NOTE,DELETE FROM T_SALESORDERITEM,DELETE FROM T_MATERIAL_T_STORE,DELETE FROM T_MATERIAL,DELETE FROM T_STORE,DELETE FROM T_SALESORDERHEADER
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/fa108dca/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_Category.properties
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_Category.properties b/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_Category.properties
new file mode 100644
index 0000000..86d4a13
--- /dev/null
+++ b/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_Category.properties
@@ -0,0 +1,22 @@
+#-------------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#-------------------------------------------------------------------------------
+query_1 = INSERT INTO T_CATEGORY (CODE,DESC) VALUES('P1','Pen');
+query_2 = INSERT INTO T_CATEGORY (CODE,DESC) VALUES('P2','Pencil');
+query_3 = INSERT INTO T_CATEGORY (CODE,DESC) VALUES('S1','Sharpner');
+query_4 = INSERT INTO T_CATEGORY (CODE,DESC) VALUES('E1','Eraser');
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/fa108dca/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_Config.properties
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_Config.properties b/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_Config.properties
new file mode 100644
index 0000000..5910123
--- /dev/null
+++ b/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_Config.properties
@@ -0,0 +1,22 @@
+#-------------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#-------------------------------------------------------------------------------
+
+#This file contains names of file which will contain the SQL statements to be executed by Data generator. Add a file name here and it will be picked up by Generator
+#You need to put the file names in order you want to get them called. First Entry will be inserted first.
+insert_file_names = SQL_Insert_Customer,SQL_Insert_Category,SQL_Insert_SalesOrderHeader,SQL_Insert_Store,SQL_Insert_Material,SQL_Insert_SalesOrderItem,SQL_Insert_Note
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/fa108dca/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_Customer.properties
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_Customer.properties b/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_Customer.properties
new file mode 100644
index 0000000..e718a01
--- /dev/null
+++ b/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_Customer.properties
@@ -0,0 +1,23 @@
+#-------------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#-------------------------------------------------------------------------------
+query_1 = INSERT INTO T_CUSTOMER (ID , NAME, HOUSE_NUMBER , STREET_NAME, CITY, COUNTRY, PINCODE) VALUES(100,'Bob Bryan',7,'5 cross Street', 'London', 'UK', 'E7');
+query_2 = INSERT INTO T_CUSTOMER (ID , NAME, HOUSE_NUMBER , STREET_NAME, CITY, COUNTRY, PINCODE) VALUES(200,'Mike Bryan',7,'8 cross Street', 'New York', 'USA', '10011');
+query_3 = INSERT INTO T_CUSTOMER (ID , NAME, HOUSE_NUMBER , STREET_NAME, CITY, COUNTRY, PINCODE) VALUES(201,'Steve Roger',7,'9 cross Street', 'Mumbai', 'India', '200101');
+query_4 = INSERT INTO T_CUSTOMER (ID , NAME, HOUSE_NUMBER , STREET_NAME, CITY, COUNTRY, PINCODE) VALUES(101,'Pac Man',7,'25 cross Street', 'Frankfurt', 'Germany', '60001');
+query_5 = INSERT INTO T_CUSTOMER (ID , NAME, HOUSE_NUMBER , STREET_NAME, CITY, COUNTRY, PINCODE) VALUES(202,'Bolt Man',7,'25 cross Street', 'Toronto', 'Canada', 'NE');
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/fa108dca/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_Material.properties
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_Material.properties b/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_Material.properties
new file mode 100644
index 0000000..7ea5ade
--- /dev/null
+++ b/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_Material.properties
@@ -0,0 +1,30 @@
+#-------------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#-------------------------------------------------------------------------------
+
+material_query_1 = insert into T_MATERIAL (MATERIAL_ID , MATERIAL_NAME, TYPE_CODE, PRICE, MEASUREMENT_UNIT) values(111, 'My Pen', 'P1', 111.1, 'Piece');
+material_query_2 = insert into T_MATERIAL (MATERIAL_ID , MATERIAL_NAME, TYPE_CODE, PRICE, MEASUREMENT_UNIT) values(112, 'My Great Pen', 'P1', 112.1, 'Piece');
+material_query_3 = insert into T_MATERIAL (MATERIAL_ID , MATERIAL_NAME, TYPE_CODE, PRICE, MEASUREMENT_UNIT) values(113, 'Super Pen', 'P1', 113.1, 'Piece');
+material_query_4 = insert into T_MATERIAL (MATERIAL_ID , MATERIAL_NAME, TYPE_CODE, PRICE, MEASUREMENT_UNIT) values(114, 'Marvel Pen', 'P1', 114.1, 'Piece');
+material_query_5 = insert into T_MATERIAL (MATERIAL_ID , MATERIAL_NAME, TYPE_CODE, PRICE, MEASUREMENT_UNIT) values(115, 'Smooth', 'P2', 115.1, 'Piece');
+material_query_6 = insert into T_MATERIAL (MATERIAL_ID , MATERIAL_NAME, TYPE_CODE, PRICE, MEASUREMENT_UNIT) values(116, 'Silver Line', 'P2', 116.1, 'Piece');
+material_query_7 = insert into T_MATERIAL (MATERIAL_ID , MATERIAL_NAME, TYPE_CODE, PRICE, MEASUREMENT_UNIT) values(117, 'Dark Line', 'P2', 117.1, 'Piece');
+material_query_8 = insert into T_MATERIAL (MATERIAL_ID , MATERIAL_NAME, TYPE_CODE, PRICE, MEASUREMENT_UNIT) values(118, 'Sharp', 'S1', 118.1, 'Piece');
+material_query_9 = insert into T_MATERIAL (MATERIAL_ID , MATERIAL_NAME, TYPE_CODE, PRICE, MEASUREMENT_UNIT) values(119, 'Cut Sharp', 'S1', 119.1, 'Piece');
+material_query_10 = insert into T_MATERIAL (MATERIAL_ID , MATERIAL_NAME, TYPE_CODE, PRICE, MEASUREMENT_UNIT) values(120, 'Thin line', 'S1', 120.1, 'Piece');
+material_query_11 = insert into T_MATERIAL (MATERIAL_ID , MATERIAL_NAME, TYPE_CODE, PRICE, MEASUREMENT_UNIT) values(121, 'Clean', 'E1', 121.1, 'Piece');
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/fa108dca/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_Note.properties
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_Note.properties b/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_Note.properties
new file mode 100644
index 0000000..347c37a
--- /dev/null
+++ b/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_Note.properties
@@ -0,0 +1,20 @@
+#-------------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#-------------------------------------------------------------------------------
+
+note_query_1 = insert into T_NOTE (SO_ID , text, createdBy, creationDate,creationTime) values(2, 'Test_Note_1', 'CreatedBy_1','2013-01-01 00:00:00','00:00:23');
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/fa108dca/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_SalesOrderHeader.properties
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_SalesOrderHeader.properties b/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_SalesOrderHeader.properties
new file mode 100644
index 0000000..b5ebf24
--- /dev/null
+++ b/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_SalesOrderHeader.properties
@@ -0,0 +1,30 @@
+#-------------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#-------------------------------------------------------------------------------
+
+query1 = insert into T_SALESORDERHEADER (SO_ID, CUST_ID, CURRENCY_CODE, DELIVERY_STATUS, creationDate) values(1, 100, 'INR', '01', '2012-11-01 00:01:00');
+query2 = insert into T_SALESORDERHEADER (SO_ID, CUST_ID, CURRENCY_CODE, DELIVERY_STATUS, creationDate) values(2, 100, 'USD', '01', '2013-01-02 00:00:00');
+query3 = insert into T_SALESORDERHEADER (SO_ID, CUST_ID, CURRENCY_CODE, DELIVERY_STATUS, creationDate) values(3, 100, 'USD', '02', '2013-01-01 14:00:00');
+query4 = insert into T_SALESORDERHEADER (SO_ID, CUST_ID, CURRENCY_CODE, DELIVERY_STATUS, creationDate) values(4, 200, 'INR', '01', '2013-01-02 00:00:00');
+query5 = insert into T_SALESORDERHEADER (SO_ID, CUST_ID, CURRENCY_CODE, DELIVERY_STATUS, creationDate) values(5, 201, 'INR', '02', '2013-01-01 14:14:14');
+query6 = insert into T_SALESORDERHEADER (SO_ID, CUST_ID, CURRENCY_CODE, DELIVERY_STATUS, creationDate) values(6, 101, 'EUR', '01', '2013-01-02 00:00:00');
+query7 = insert into T_SALESORDERHEADER (SO_ID, CUST_ID, CURRENCY_CODE, DELIVERY_STATUS, creationDate) values(7, 201, 'EUR', '02', '2013-01-01 14:14:00');
+query8 = insert into T_SALESORDERHEADER (SO_ID, CUST_ID, CURRENCY_CODE, DELIVERY_STATUS, creationDate) values(8, 201, 'GBR', '01', '2013-01-02 00:00:00');
+query9 = insert into T_SALESORDERHEADER (SO_ID, CUST_ID, CURRENCY_CODE, DELIVERY_STATUS, creationDate) values(9, 101, 'GBR', '02', '2013-01-01 00:00:00');
+query10 = insert into T_SALESORDERHEADER (SO_ID, CUST_ID, CURRENCY_CODE, DELIVERY_STATUS, creationDate) values(10, 100, 'AUD', '01', '2013-01-01 00:00:00');
+query11 = insert into T_SALESORDERHEADER (SO_ID, CUST_ID, CURRENCY_CODE, DELIVERY_STATUS, creationDate) values(11, 202, 'AUD', '02', '2013-01-02 00:00:00');
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/fa108dca/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_SalesOrderItem.properties
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_SalesOrderItem.properties b/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_SalesOrderItem.properties
new file mode 100644
index 0000000..ed93834
--- /dev/null
+++ b/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_SalesOrderItem.properties
@@ -0,0 +1,30 @@
+#-------------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#-------------------------------------------------------------------------------
+
+line_item_query1 = insert into T_SALESORDERITEM (Material_Id , quantity , amount , discount , Sales_Order_Id , Sales_Order_Item_Id ) values(111, 1, 10.1, 1.11, 3, 11);
+line_item_query2 = insert into T_SALESORDERITEM (Material_Id , quantity , amount , discount , Sales_Order_Id , Sales_Order_Item_Id ) values(112, 1, 111.1, 1.12, 2, 10);
+line_item_query3 = insert into T_SALESORDERITEM (Material_Id , quantity , amount , discount , Sales_Order_Id , Sales_Order_Item_Id ) values(113, 1, 211.1, 1.13, 3, 9);
+line_item_query4 = insert into T_SALESORDERITEM (Material_Id , quantity , amount , discount , Sales_Order_Id , Sales_Order_Item_Id ) values(114, 1, 221.1, 1.14, 4, 8);
+line_item_query5 = insert into T_SALESORDERITEM (Material_Id , quantity , amount , discount , Sales_Order_Id , Sales_Order_Item_Id ) values(115, 1, 651.1, 1.15, 5, 7);
+line_item_query6 = insert into T_SALESORDERITEM (Material_Id , quantity , amount , discount , Sales_Order_Id , Sales_Order_Item_Id ) values(116, 1, 653.21, 1.16, 6, 6);
+line_item_query7 = insert into T_SALESORDERITEM (Material_Id , quantity , amount , discount , Sales_Order_Id , Sales_Order_Item_Id ) values(117, 1, 57.11, 1.17, 7, 5);
+line_item_query8 = insert into T_SALESORDERITEM (Material_Id , quantity , amount , discount , Sales_Order_Id , Sales_Order_Item_Id ) values(118, 1, 52.98, 1.18, 8, 4);
+line_item_query9 = insert into T_SALESORDERITEM (Material_Id , quantity , amount , discount , Sales_Order_Id , Sales_Order_Item_Id ) values(119, 1, 78.99, 1.19, 9, 3);
+line_item_query10 = insert into T_SALESORDERITEM (Material_Id , quantity , amount , discount , Sales_Order_Id , Sales_Order_Item_Id ) values(120, 1,69.23, 1.20, 10, 2);
+line_item_query11 = insert into T_SALESORDERITEM (Material_Id , quantity , amount , discount , Sales_Order_Id , Sales_Order_Item_Id ) values(121, 1, 356.65, 1.21, 3, 1);
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/fa108dca/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_Store.properties
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_Store.properties b/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_Store.properties
new file mode 100644
index 0000000..20860f2
--- /dev/null
+++ b/odata2-jpa-processor/jpa-web/src/main/resources/SQL_Insert_Store.properties
@@ -0,0 +1,30 @@
+#-------------------------------------------------------------------------------
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#-------------------------------------------------------------------------------
+
+store_query_1 = insert into T_STORE (STORE_ID , STORE_NAME, HOUSE_NUMBER, STREET_NAME, CITY, COUNTRY, PINCODE) values(131, 'Store New York', 11, 'New York Street', 'New York', 'USA','10001');
+store_query_2 = insert into T_STORE (STORE_ID , STORE_NAME, HOUSE_NUMBER, STREET_NAME, CITY, COUNTRY, PINCODE) values(132, 'Store Bengaluru', 21, 'Whitefield', 'Bengaluru', 'India','560037');
+store_query_3 = insert into T_STORE (STORE_ID , STORE_NAME, HOUSE_NUMBER, STREET_NAME, CITY, COUNTRY, PINCODE) values(133, 'Store Toronto', 31, 'Toronto Street', 'Toronto', 'Canada','M4J');
+store_query_4 = insert into T_STORE (STORE_ID , STORE_NAME, HOUSE_NUMBER, STREET_NAME, CITY, COUNTRY, PINCODE) values(134, 'Store Chicago', 41, 'Chicago Street', 'Chicago', 'USA','60625');
+store_query_5 = insert into T_STORE (STORE_ID , STORE_NAME, HOUSE_NUMBER, STREET_NAME, CITY, COUNTRY, PINCODE) values(135, 'Store Chennai', 51, 'Park Street', 'Chennai', 'India','600021');
+store_query_6 = insert into T_STORE (STORE_ID , STORE_NAME, HOUSE_NUMBER, STREET_NAME, CITY, COUNTRY, PINCODE) values(136, 'Store Frankfurt', 61, 'Frankfurt Street', 'Frankfurt', 'Germany','60001');
+store_query_7 = insert into T_STORE (STORE_ID , STORE_NAME, HOUSE_NUMBER, STREET_NAME, CITY, COUNTRY, PINCODE) values(137, 'Store Berlin', 71, 'Berlin Street', 'Berlin', 'Germany','10115');
+store_query_8 = insert into T_STORE (STORE_ID , STORE_NAME, HOUSE_NUMBER, STREET_NAME, CITY, COUNTRY, PINCODE) values(138, 'Store Hamburg', 81, 'Hamburg Street', 'Hamburg', 'Germany','20001');
+store_query_9 = insert into T_STORE (STORE_ID , STORE_NAME, HOUSE_NUMBER, STREET_NAME, CITY, COUNTRY, PINCODE) values(139, 'Store New Delhi', 91, 'New Delhi Street', 'New Delhi', 'India','110001');
+store_query_10 = insert into T_STORE (STORE_ID , STORE_NAME, HOUSE_NUMBER, STREET_NAME, CITY, COUNTRY, PINCODE) values(140, 'Store Ottawa', 100, 'Ottawa Street', 'Ottawa', 'Canada','K0A');
+store_query_11 = insert into T_STORE (STORE_ID , STORE_NAME, HOUSE_NUMBER, STREET_NAME, CITY, COUNTRY, PINCODE) values(141, 'Store Kolkata', 101, 'Kolkata Street', 'Kolkata', 'India','310001');
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/fa108dca/odata2-jpa-processor/jpa-web/src/main/resources/SalesOrderHeaderSQLs.properties
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-web/src/main/resources/SalesOrderHeaderSQLs.properties b/odata2-jpa-processor/jpa-web/src/main/resources/SalesOrderHeaderSQLs.properties
deleted file mode 100644
index bc3e5a3..0000000
--- a/odata2-jpa-processor/jpa-web/src/main/resources/SalesOrderHeaderSQLs.properties
+++ /dev/null
@@ -1,30 +0,0 @@
-#-------------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#-------------------------------------------------------------------------------
-
-query1 = insert into T_SALESORDERHEADER (SO_ID, BUYER_ID, BUYER_NAME, CURRENCY_CODE, DELIVERY_STATUS, creationDate, HOUSE_NUMBER, STREET_NAME, CITY, COUNTRY) values(20130320170725, 1, 'buyerName_1', 'INR', '01', '2012-11-01 00:01:00', 1, 'Test_Street_Name_1', 'Test_City_1', 'Test_Country_1');
-query2 = insert into T_SALESORDERHEADER (SO_ID, BUYER_ID, BUYER_NAME, CURRENCY_CODE, DELIVERY_STATUS, creationDate, HOUSE_NUMBER, STREET_NAME, CITY, COUNTRY) values(2, 2, 'buyerName_2', 'USD', '01', '2013-01-02 00:00:00', 2, 'Test_Street_Name_2', 'Test_City_2', 'Test_Country_2');
-query3 = insert into T_SALESORDERHEADER (SO_ID, BUYER_ID, BUYER_NAME, CURRENCY_CODE, DELIVERY_STATUS, creationDate, HOUSE_NUMBER, STREET_NAME, CITY, COUNTRY) values(3, 3, 'buyerName_3', 'USD', '02', '2013-01-01 14:00:00', 3, 'Test_Street_Name_3', 'Test_City_3', 'Test_Country_3');
-query4 = insert into T_SALESORDERHEADER (SO_ID, BUYER_ID, BUYER_NAME, CURRENCY_CODE, DELIVERY_STATUS, creationDate, HOUSE_NUMBER, STREET_NAME, CITY, COUNTRY) values(4, 4, 'buyerName_4', 'INR', '01', '2013-01-02 00:00:00', 4, 'Test_Street_Name_4', 'Test_City_4', 'Test_Country_4');
-query5 = insert into T_SALESORDERHEADER (SO_ID, BUYER_ID, BUYER_NAME, CURRENCY_CODE, DELIVERY_STATUS, creationDate, HOUSE_NUMBER, STREET_NAME, CITY, COUNTRY) values(5, 5, 'buyerName_5', 'INR', '02', '2013-01-01 14:14:14', 5, 'Test_Street_Name_5', 'Test_City_5', 'Test_Country_5');
-query6 = insert into T_SALESORDERHEADER (SO_ID, BUYER_ID, BUYER_NAME, CURRENCY_CODE, DELIVERY_STATUS, creationDate, HOUSE_NUMBER, STREET_NAME, CITY, COUNTRY) values(6, 6, 'buyerName_6', 'EUR', '01', '2013-01-02 00:00:00', 6, 'Test_Street_Name_6', 'Test_City_6', 'Test_Country_6');
-query7 = insert into T_SALESORDERHEADER (SO_ID, BUYER_ID, BUYER_NAME, CURRENCY_CODE, DELIVERY_STATUS, creationDate, HOUSE_NUMBER, STREET_NAME, CITY, COUNTRY) values(7, 7, 'buyerName_7', 'EUR', '02', '2013-01-01 14:14:00', 7, 'Test_Street_Name_7', 'Test_City_7', 'Test_Country_7');
-query8 = insert into T_SALESORDERHEADER (SO_ID, BUYER_ID, BUYER_NAME, CURRENCY_CODE, DELIVERY_STATUS, creationDate, HOUSE_NUMBER, STREET_NAME, CITY, COUNTRY) values(8, 8, 'buyerName_8', 'GBR', '01', '2013-01-02 00:00:00', 8, 'Test_Street_Name_8', 'Test_City_8', 'Test_Country_8');
-query9 = insert into T_SALESORDERHEADER (SO_ID, BUYER_ID, BUYER_NAME, CURRENCY_CODE, DELIVERY_STATUS, creationDate, HOUSE_NUMBER, STREET_NAME, CITY, COUNTRY) values(9, 9, 'buyerName_9', 'GBR', '02', '2013-01-01 00:00:00', 9, 'Test_Street_Name_9', 'Test_City_9', 'Test_Country_9');
-query10 = insert into T_SALESORDERHEADER (SO_ID, BUYER_ID, BUYER_NAME, CURRENCY_CODE, DELIVERY_STATUS, creationDate, HOUSE_NUMBER, STREET_NAME, CITY, COUNTRY) values(10, 10, 'buyerName_10', 'AUD', '01', '2013-01-01 00:00:00', 10, 'Test_Street_Name_10', 'Test_City_10', 'Test_Country_10');
-query11 = insert into T_SALESORDERHEADER (SO_ID, BUYER_ID, BUYER_NAME, CURRENCY_CODE, DELIVERY_STATUS, creationDate, HOUSE_NUMBER, STREET_NAME, CITY, COUNTRY) values(11, 11, 'buyerName_11', 'AUD', '02', '2013-01-02 00:00:00', 7, 'Test_Street_Name_11', 'Test_City_11', 'Test_Country_3');
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/fa108dca/odata2-jpa-processor/jpa-web/src/main/resources/SalesOrderItemSQLs.properties
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-web/src/main/resources/SalesOrderItemSQLs.properties b/odata2-jpa-processor/jpa-web/src/main/resources/SalesOrderItemSQLs.properties
deleted file mode 100644
index ed93834..0000000
--- a/odata2-jpa-processor/jpa-web/src/main/resources/SalesOrderItemSQLs.properties
+++ /dev/null
@@ -1,30 +0,0 @@
-#-------------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#-------------------------------------------------------------------------------
-
-line_item_query1 = insert into T_SALESORDERITEM (Material_Id , quantity , amount , discount , Sales_Order_Id , Sales_Order_Item_Id ) values(111, 1, 10.1, 1.11, 3, 11);
-line_item_query2 = insert into T_SALESORDERITEM (Material_Id , quantity , amount , discount , Sales_Order_Id , Sales_Order_Item_Id ) values(112, 1, 111.1, 1.12, 2, 10);
-line_item_query3 = insert into T_SALESORDERITEM (Material_Id , quantity , amount , discount , Sales_Order_Id , Sales_Order_Item_Id ) values(113, 1, 211.1, 1.13, 3, 9);
-line_item_query4 = insert into T_SALESORDERITEM (Material_Id , quantity , amount , discount , Sales_Order_Id , Sales_Order_Item_Id ) values(114, 1, 221.1, 1.14, 4, 8);
-line_item_query5 = insert into T_SALESORDERITEM (Material_Id , quantity , amount , discount , Sales_Order_Id , Sales_Order_Item_Id ) values(115, 1, 651.1, 1.15, 5, 7);
-line_item_query6 = insert into T_SALESORDERITEM (Material_Id , quantity , amount , discount , Sales_Order_Id , Sales_Order_Item_Id ) values(116, 1, 653.21, 1.16, 6, 6);
-line_item_query7 = insert into T_SALESORDERITEM (Material_Id , quantity , amount , discount , Sales_Order_Id , Sales_Order_Item_Id ) values(117, 1, 57.11, 1.17, 7, 5);
-line_item_query8 = insert into T_SALESORDERITEM (Material_Id , quantity , amount , discount , Sales_Order_Id , Sales_Order_Item_Id ) values(118, 1, 52.98, 1.18, 8, 4);
-line_item_query9 = insert into T_SALESORDERITEM (Material_Id , quantity , amount , discount , Sales_Order_Id , Sales_Order_Item_Id ) values(119, 1, 78.99, 1.19, 9, 3);
-line_item_query10 = insert into T_SALESORDERITEM (Material_Id , quantity , amount , discount , Sales_Order_Id , Sales_Order_Item_Id ) values(120, 1,69.23, 1.20, 10, 2);
-line_item_query11 = insert into T_SALESORDERITEM (Material_Id , quantity , amount , discount , Sales_Order_Id , Sales_Order_Item_Id ) values(121, 1, 356.65, 1.21, 3, 1);
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/fa108dca/odata2-jpa-processor/jpa-web/src/main/resources/StoreSQLs.properties
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-web/src/main/resources/StoreSQLs.properties b/odata2-jpa-processor/jpa-web/src/main/resources/StoreSQLs.properties
deleted file mode 100644
index 69af954..0000000
--- a/odata2-jpa-processor/jpa-web/src/main/resources/StoreSQLs.properties
+++ /dev/null
@@ -1,30 +0,0 @@
-#-------------------------------------------------------------------------------
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#-------------------------------------------------------------------------------
-
-store_query_1 = insert into T_STORE (STORE_ID , STORE_NAME, HOUSE_NUMBER, STREET_NAME, CITY, COUNTRY) values(131, 'Test_Store_1', 1, 'Test_Street_Name_1', 'Test_City_1', 'Test_Country_1');
-store_query_2 = insert into T_STORE (STORE_ID , STORE_NAME, HOUSE_NUMBER, STREET_NAME, CITY, COUNTRY) values(132, 'Test_Store_2', 1, 'Test_Street_Name_2', 'Test_City_2', 'Test_Country_2');
-store_query_3 = insert into T_STORE (STORE_ID , STORE_NAME, HOUSE_NUMBER, STREET_NAME, CITY, COUNTRY) values(133, 'Test_Store_3', 1, 'Test_Street_Name_3', 'Test_City_3', 'Test_Country_3');
-store_query_4 = insert into T_STORE (STORE_ID , STORE_NAME, HOUSE_NUMBER, STREET_NAME, CITY, COUNTRY) values(134, 'Test_Store_4', 1, 'Test_Street_Name_4', 'Test_City_4', 'Test_Country_4');
-store_query_5 = insert into T_STORE (STORE_ID , STORE_NAME, HOUSE_NUMBER, STREET_NAME, CITY, COUNTRY) values(135, 'Test_Store_5', 1, 'Test_Street_Name_5', 'Test_City_5', 'Test_Country_5');
-store_query_6 = insert into T_STORE (STORE_ID , STORE_NAME, HOUSE_NUMBER, STREET_NAME, CITY, COUNTRY) values(136, 'Test_Store_6', 1, 'Test_Street_Name_6', 'Test_City_6', 'Test_Country_6');
-store_query_7 = insert into T_STORE (STORE_ID , STORE_NAME, HOUSE_NUMBER, STREET_NAME, CITY, COUNTRY) values(137, 'Test_Store_7', 1, 'Test_Street_Name_7', 'Test_City_7', 'Test_Country_7');
-store_query_8 = insert into T_STORE (STORE_ID , STORE_NAME, HOUSE_NUMBER, STREET_NAME, CITY, COUNTRY) values(138, 'Test_Store_8', 1, 'Test_Street_Name_8', 'Test_City_8', 'Test_Country_8');
-store_query_9 = insert into T_STORE (STORE_ID , STORE_NAME, HOUSE_NUMBER, STREET_NAME, CITY, COUNTRY) values(139, 'Test_Store_9', 1, 'Test_Street_Name_9', 'Test_City_9', 'Test_Country_9');
-store_query_10 = insert into T_STORE (STORE_ID , STORE_NAME, HOUSE_NUMBER, STREET_NAME, CITY, COUNTRY) values(140, 'Test_Store_10', 1, 'Test_Street_Name_10', 'Test_City_10', 'Test_Country_10');
-store_query_11 = insert into T_STORE (STORE_ID , STORE_NAME, HOUSE_NUMBER, STREET_NAME, CITY, COUNTRY) values(141, 'Test_Store_11', 1, 'Test_Street_Name_11', 'Test_City_11', 'Test_Country_11');
\ No newline at end of file
[05/12] git commit: [OLINGO-88] Added archetype project for
'annotation-processor'
Posted by sk...@apache.org.
[OLINGO-88] Added archetype project for 'annotation-processor'
Project: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/commit/17a1b04f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/tree/17a1b04f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/diff/17a1b04f
Branch: refs/heads/olingo-117
Commit: 17a1b04f438c77259c69511d022456cbc75bc148
Parents: d98180e
Author: Michael Bolz <mi...@apache.org>
Authored: Thu Jan 9 10:20:34 2014 +0100
Committer: Stephan Klevenz <sk...@apache.org>
Committed: Tue Jan 14 12:24:42 2014 +0100
----------------------------------------------------------------------
odata2-sample/cars-annotation-archetype/pom.xml | 70 +++++++
.../META-INF/maven/archetype-metadata.xml | 41 ++++
.../main/resources/archetype-resources/pom.xml | 148 ++++++++++++++
.../src/main/java/model/Address.java | 79 ++++++++
.../src/main/java/model/Car.java | 115 +++++++++++
.../src/main/java/model/Driver.java | 104 ++++++++++
.../src/main/java/model/Manufacturer.java | 98 ++++++++++
.../src/main/java/model/ResourceHelper.java | 96 +++++++++
.../AnnotationSampleServiceFactory.java | 195 +++++++++++++++++++
.../src/main/resources/log4j.xml | 47 +++++
.../src/main/version/version.html | 29 +++
.../src/main/webapp/WEB-INF/web.xml | 51 +++++
.../src/main/webapp/index.jsp | 115 +++++++++++
.../projects/basic/archetype.properties | 5 +
.../src/test/resources/projects/basic/goal.txt | 0
odata2-sample/pom.xml | 1 +
16 files changed, 1194 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/17a1b04f/odata2-sample/cars-annotation-archetype/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/pom.xml b/odata2-sample/cars-annotation-archetype/pom.xml
new file mode 100644
index 0000000..f275010
--- /dev/null
+++ b/odata2-sample/cars-annotation-archetype/pom.xml
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+ license agreements. See the NOTICE file distributed with this work for additional
+ information regarding copyright ownership. The ASF licenses this file to
+ you under the Apache License, Version 2.0 (the "License"); you may not use
+ this file except in compliance with the License. You may obtain a copy of
+ the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+ by applicable law or agreed to in writing, software distributed under the
+ License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ OF ANY KIND, either express or implied. See the License for the specific
+ language governing permissions and limitations under the License. -->
+<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/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.apache.olingo</groupId>
+ <artifactId>olingo-odata2-sample-cars-annotation-archetype-incubating</artifactId>
+ <name>${project.artifactId}</name>
+ <version>1.1.0-SNAPSHOT</version>
+ <packaging>maven-archetype</packaging>
+
+ <parent>
+ <groupId>org.apache.olingo</groupId>
+ <artifactId>olingo-odata2-sample-incubating</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ <relativePath>..</relativePath>
+ </parent>
+
+ <build>
+ <extensions>
+ <extension>
+ <groupId>org.apache.maven.archetype</groupId>
+ <artifactId>archetype-packaging</artifactId>
+ <version>2.2</version>
+ </extension>
+ </extensions>
+
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-archetype-plugin</artifactId>
+ <version>2.2</version>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-archetype-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>integration-test</id>
+ <goals>
+ <goal>integration-test</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-eclipse-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/17a1b04f/odata2-sample/cars-annotation-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml b/odata2-sample/cars-annotation-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
new file mode 100644
index 0000000..81286c8
--- /dev/null
+++ b/odata2-sample/cars-annotation-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<archetype-descriptor
+ xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0 http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd"
+ name="olingo-odata2-sample-cars-annotation-incubating"
+ xmlns="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <fileSets>
+ <fileSet filtered="true" packaged="true" encoding="UTF-8">
+ <directory>src/main/java</directory>
+ <includes>
+ <include>**/*.java</include>
+ </includes>
+ </fileSet>
+ <fileSet filtered="true" encoding="UTF-8">
+ <directory>src/main/version</directory>
+ <includes>
+ <include>**/*.html</include>
+ </includes>
+ </fileSet>
+ <fileSet filtered="true" encoding="UTF-8">
+ <directory>src/main/webapp</directory>
+ <includes>
+ <include>**/*.jsp</include>
+ <include>**/*.xml</include>
+ </includes>
+ </fileSet>
+ <fileSet filtered="true" encoding="UTF-8">
+ <directory>src/main/resources</directory>
+ <includes>
+ <include>**/*.xml</include>
+ </includes>
+ </fileSet>
+ <fileSet filtered="true" encoding="UTF-8">
+ <directory></directory>
+ <includes>
+ <include>.classpath</include>
+ <include>.project</include>
+ </includes>
+ </fileSet>
+ </fileSets>
+</archetype-descriptor>
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/17a1b04f/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml
new file mode 100644
index 0000000..100d87b
--- /dev/null
+++ b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/pom.xml
@@ -0,0 +1,148 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor
+ license agreements. See the NOTICE file distributed with this work for additional
+ information regarding copyright ownership. The ASF licenses this file to
+ you under the Apache License, Version 2.0 (the "License"); you may not use
+ this file except in compliance with the License. You may obtain a copy of
+ the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required
+ by applicable law or agreed to in writing, software distributed under the
+ License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ OF ANY KIND, either express or implied. See the License for the specific
+ language governing permissions and limitations under the License. -->
+<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/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>${groupId}</groupId>
+ <artifactId>${artifactId}</artifactId>
+ <version>${version}</version>
+ <name>${project.artifactId}</name>
+
+ <packaging>war</packaging>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <!-- Plugin Versions -->
+ <version.compiler-plugin>2.3.2</version.compiler-plugin>
+ <version.deploy-plugin>2.8.1</version.deploy-plugin>
+ <version.eclipse-plugin>2.9</version.eclipse-plugin>
+ <version.jetty-plugin>9.0.6.v20130930</version.jetty-plugin>
+ <!-- Dependency Versions -->
+ <version.cxf>2.7.6</version.cxf>
+ <version.servlet-api>2.5</version.servlet-api>
+ <version.jaxrs-api>2.0-m10</version.jaxrs-api>
+ <version.slf4j>1.7.1</version.slf4j>
+ <version.olingo>1.1.0-SNAPSHOT</version.olingo>
+ </properties>
+
+ <build>
+ <finalName>${project.artifactId}</finalName>
+ <defaultGoal>package jetty:run</defaultGoal>
+ <resources>
+ <resource>
+ <directory>src/main/version</directory>
+ <filtering>true</filtering>
+ <targetPath>../${project.build.finalName}/gen</targetPath>
+ </resource>
+ <resource>
+ <directory>src/main/resources</directory>
+ <filtering>true</filtering>
+ </resource>
+ <resource>
+ <directory>target/maven-shared-archive-resources</directory>
+ </resource>
+ </resources>
+
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>${version.compiler-plugin}</version>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <version>${version.deploy-plugin}</version>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-eclipse-plugin</artifactId>
+ <version>${version.eclipse-plugin}</version>
+ <configuration>
+ <addGroupIdToProjectName>true</addGroupIdToProjectName>
+ <addVersionToProjectName>true</addVersionToProjectName>
+ <wtpversion>2.0</wtpversion>
+ <downloadSources>true</downloadSources>
+ <downloadJavadocs>true</downloadJavadocs>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.eclipse.jetty</groupId>
+ <artifactId>jetty-maven-plugin</artifactId>
+ <version>${version.jetty-plugin}</version>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <!-- Apache Olingo Library dependencies -->
+ <dependency>
+ <groupId>org.apache.olingo</groupId>
+ <artifactId>olingo-odata2-api-incubating</artifactId>
+ <version>${version.olingo}</version>
+ </dependency>
+ <dependency>
+ <artifactId>olingo-odata2-api-annotation-incubating</artifactId>
+ <groupId>org.apache.olingo</groupId>
+ <type>jar</type>
+ <version>${version.olingo}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.olingo</groupId>
+ <artifactId>olingo-odata2-core-incubating</artifactId>
+ <version>${version.olingo}</version>
+ </dependency>
+ <!-- Apache Olingo Annotation Processor Extension dependencies -->
+ <dependency>
+ <groupId>org.apache.olingo</groupId>
+ <artifactId>olingo-odata2-annotation-processor-api-incubating</artifactId>
+ <version>${version.olingo}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.olingo</groupId>
+ <artifactId>olingo-odata2-annotation-processor-core-incubating</artifactId>
+ <version>${version.olingo}</version>
+ </dependency>
+ <!-- Additional dependencies -->
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>${version.slf4j}</version>
+ </dependency>
+ <!-- Servlet/REST dependencies -->
+ <dependency>
+ <!-- required because of auto detection of web facet 2.5 -->
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>${version.servlet-api}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>javax.ws.rs</groupId>
+ <artifactId>javax.ws.rs-api</artifactId>
+ <version>${version.jaxrs-api}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cxf</groupId>
+ <artifactId>cxf-rt-frontend-jaxrs</artifactId>
+ <version>${version.cxf}</version>
+ </dependency>
+ </dependencies>
+</project>
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/17a1b04f/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/model/Address.java
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/model/Address.java b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/model/Address.java
new file mode 100644
index 0000000..66ea6b9
--- /dev/null
+++ b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/model/Address.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+package ${package}.model;
+
+import org.apache.olingo.odata2.api.annotation.edm.EdmComplexType;
+import org.apache.olingo.odata2.api.annotation.edm.EdmProperty;
+
+/**
+ *
+ */
+@EdmComplexType(name = "Address", namespace = "MyFormula")
+public class Address {
+
+ @EdmProperty
+ private String street;
+ @EdmProperty
+ private String city;
+ @EdmProperty
+ private String zipCode;
+ @EdmProperty
+ private String country;
+
+ public String getStreet() {
+ return street;
+ }
+
+ public void setStreet(String street) {
+ this.street = street;
+ }
+
+ public String getCity() {
+ return city;
+ }
+
+ public void setCity(String city) {
+ this.city = city;
+ }
+
+ public String getZipCode() {
+ return zipCode;
+ }
+
+ public void setZipCode(String zipCode) {
+ this.zipCode = zipCode;
+ }
+
+ public String getCountry() {
+ return country;
+ }
+
+ public void setCountry(String country) {
+ this.country = country;
+ }
+
+ @Override
+ public String toString() {
+ return "Address{" + "street=" + street + ", city=" + city + ", zipCode=" + zipCode + ", country=" + country + '}';
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/17a1b04f/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/model/Car.java
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/model/Car.java b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/model/Car.java
new file mode 100644
index 0000000..26deb78
--- /dev/null
+++ b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/model/Car.java
@@ -0,0 +1,115 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+package ${package}.model;
+
+import java.util.Date;
+import org.apache.olingo.odata2.api.annotation.edm.EdmEntitySet;
+import org.apache.olingo.odata2.api.annotation.edm.EdmEntityType;
+import org.apache.olingo.odata2.api.annotation.edm.EdmKey;
+import org.apache.olingo.odata2.api.annotation.edm.EdmNavigationProperty;
+import org.apache.olingo.odata2.api.annotation.edm.EdmProperty;
+
+/**
+ *
+ */
+@EdmEntityType(namespace = "MyFormula")
+@EdmEntitySet(name = "Cars")
+public class Car {
+
+ @EdmKey
+ @EdmProperty
+ private String id;
+ @EdmProperty
+ private String model;
+ @EdmNavigationProperty
+ private Manufacturer manufacturer;
+ @EdmNavigationProperty
+ private Driver driver;
+ @EdmProperty
+ private Double price;
+ @EdmProperty
+ private Integer modelYear;
+ @EdmProperty
+ private Date updated;
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getModel() {
+ return model;
+ }
+
+ public void setModel(String model) {
+ this.model = model;
+ }
+
+ public Manufacturer getManufacturer() {
+ return manufacturer;
+ }
+
+ public void setManufacturer(Manufacturer manufacturer) {
+ this.manufacturer = manufacturer;
+ }
+
+ public double getPrice() {
+ return price;
+ }
+
+ public void setPrice(double price) {
+ this.price = price;
+ }
+
+ public int getModelYear() {
+ return modelYear;
+ }
+
+ public void setModelYear(int modelYear) {
+ this.modelYear = modelYear;
+ }
+
+ public Date getUpdated() {
+ return updated;
+ }
+
+ public void setUpdated(Date updated) {
+ this.updated = updated;
+ }
+
+ public Driver getDriver() {
+ return driver;
+ }
+
+ public void setDriver(Driver driver) {
+ this.driver = driver;
+ }
+
+ @Override
+ public String toString() {
+ return "Car{" + "id=" + id + ", model=" + model + ", manufacturer id=" + manufacturer.getId() + ", driver id=" + driver.getId() +
+ ", price=" + price + ", modelYear=" + modelYear + ", updated=" + updated + '}';
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/17a1b04f/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/model/Driver.java
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/model/Driver.java b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/model/Driver.java
new file mode 100644
index 0000000..594e002
--- /dev/null
+++ b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/model/Driver.java
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+package ${package}.model;
+
+import java.util.Calendar;
+import org.apache.olingo.odata2.api.annotation.edm.EdmEntitySet;
+import org.apache.olingo.odata2.api.annotation.edm.EdmEntityType;
+import org.apache.olingo.odata2.api.annotation.edm.EdmKey;
+import org.apache.olingo.odata2.api.annotation.edm.EdmNavigationProperty;
+import org.apache.olingo.odata2.api.annotation.edm.EdmProperty;
+import org.apache.olingo.odata2.api.annotation.edm.EdmType;
+
+/**
+ *
+ */
+@EdmEntityType(namespace = "MyFormula")
+@EdmEntitySet(name = "Drivers")
+public class Driver {
+
+ @EdmKey
+ @EdmProperty
+ private Long id;
+
+ @EdmProperty
+ private String name;
+ @EdmProperty
+ private String lastname;
+ @EdmProperty
+ private String nickname;
+ @EdmNavigationProperty(name = "Car")
+ private Car car;
+ @EdmProperty(type = EdmType.DATE_TIME)
+ private Calendar birthday;
+
+ public Long getId() {
+ return id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getLastname() {
+ return lastname;
+ }
+
+ public void setLastname(String lastname) {
+ this.lastname = lastname;
+ }
+
+ public String getNickname() {
+ return nickname;
+ }
+
+ public void setNickname(String nickname) {
+ this.nickname = nickname;
+ }
+
+ public Car getCar() {
+ return car;
+ }
+
+ public void setCar(Car car) {
+ this.car = car;
+ }
+
+ public Calendar getUpdated() {
+ return birthday;
+ }
+
+ public void setBirthday(Calendar birthday) {
+ this.birthday = birthday;
+ }
+
+ @Override
+ public String toString() {
+ return "Driver{id=" + id + ", name=" + name + ", lastname=" + lastname + ", nickname=" + nickname
+ + ", car id=" + car.getId() + ", updated=" + birthday + '}';
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/17a1b04f/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/model/Manufacturer.java
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/model/Manufacturer.java b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/model/Manufacturer.java
new file mode 100644
index 0000000..2e8163c
--- /dev/null
+++ b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/model/Manufacturer.java
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+package ${package}.model;
+
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.List;
+import org.apache.olingo.odata2.api.annotation.edm.EdmEntitySet;
+import org.apache.olingo.odata2.api.annotation.edm.EdmEntityType;
+import org.apache.olingo.odata2.api.annotation.edm.EdmKey;
+import org.apache.olingo.odata2.api.annotation.edm.EdmNavigationProperty;
+import org.apache.olingo.odata2.api.annotation.edm.EdmNavigationProperty.Multiplicity;
+import org.apache.olingo.odata2.api.annotation.edm.EdmProperty;
+
+/**
+ *
+ */
+@EdmEntityType(namespace = "MyFormula")
+@EdmEntitySet(name = "Manufacturers")
+public class Manufacturer {
+
+ @EdmKey
+ @EdmProperty
+ private String id;
+ @EdmProperty
+ private String name;
+ @EdmProperty
+ private Calendar founded;
+ @EdmProperty
+ private Address address;
+ @EdmNavigationProperty(name = "Cars", toType = Car.class, toMultiplicity = Multiplicity.MANY)
+ private List<Car> cars = new ArrayList<Car>();
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public Calendar getUpdated() {
+ return founded;
+ }
+
+ public void setFounded(Calendar updated) {
+ this.founded = updated;
+ }
+
+ public Address getAddress() {
+ return address;
+ }
+
+ public void setAddress(Address address) {
+ this.address = address;
+ }
+
+ public List<Car> getCars() {
+ return cars;
+ }
+
+ public void setCars(List<Car> cars) {
+ this.cars = cars;
+ }
+
+ @Override
+ public String toString() {
+ return "Manufacturer{" + "id=" + id + ", name=" + name + ", updated=" + founded +
+ ", address=" + address + ", cars=" + cars.size() + '}';
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/17a1b04f/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/model/ResourceHelper.java
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/model/ResourceHelper.java b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/model/ResourceHelper.java
new file mode 100644
index 0000000..d509d28
--- /dev/null
+++ b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/model/ResourceHelper.java
@@ -0,0 +1,96 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+package ${package}.model;
+
+import java.awt.image.BufferedImage;
+import java.awt.image.WritableRaster;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import javax.imageio.ImageIO;
+
+/**
+ *
+ */
+public class ResourceHelper {
+
+ public static byte[] loadAsByte(String resource) {
+ return load(resource, new byte[0]);
+ }
+
+ public static byte[] load(String resource, byte[] defaultResult) {
+ InputStream instream = null;
+ try {
+ instream = Thread.currentThread().getContextClassLoader().getResourceAsStream(resource);
+ if (instream == null) {
+ return defaultResult;
+ }
+ ByteArrayOutputStream stream = new ByteArrayOutputStream();
+ int b = 0;
+ while ((b = instream.read()) != -1) {
+ stream.write(b);
+ }
+
+ return stream.toByteArray();
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ } finally {
+ if(instream != null) {
+ try {
+ instream.close();
+ } catch (IOException ex) { }
+ }
+ }
+ }
+
+ public enum Format {BMP, JPEG, PNG, GIF};
+
+ public static byte[] generateImage() {
+ return generateImage(Format.PNG);
+ }
+
+ public static byte[] generateImage(Format format) {
+ try {
+ int width = 320;
+ int height = 320;
+ BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_BYTE_BINARY);
+ WritableRaster raster = image.getRaster();
+
+ int mod = format.ordinal() + 2;
+ for (int h = 0; h < height; h++) {
+ for (int w = 0; w < width; w++) {
+ if (((h / 32) + (w / 32)) % mod == 0) {
+ raster.setSample(w, h, 0, 0);
+ } else {
+ raster.setSample(w, h, 0, 1);
+ }
+ }
+ }
+
+ ByteArrayOutputStream out = new ByteArrayOutputStream(1024);
+ ImageIO.write(image, format.name(), out);
+ return out.toByteArray();
+ } catch (IOException ex) {
+ return new byte[0];
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/17a1b04f/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/processor/AnnotationSampleServiceFactory.java
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/processor/AnnotationSampleServiceFactory.java b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/processor/AnnotationSampleServiceFactory.java
new file mode 100644
index 0000000..5b346cc
--- /dev/null
+++ b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/java/processor/AnnotationSampleServiceFactory.java
@@ -0,0 +1,195 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+package ${package}.processor;
+
+import ${package}.model.Address;
+import ${package}.model.Car;
+import ${package}.model.Driver;
+import ${package}.model.Manufacturer;
+import java.util.Calendar;
+import java.util.Locale;
+import org.apache.olingo.odata2.annotation.processor.api.AnnotationServiceFactory;
+import org.apache.olingo.odata2.annotation.processor.core.datasource.DataStore;
+import org.apache.olingo.odata2.api.ODataCallback;
+import org.apache.olingo.odata2.api.ODataDebugCallback;
+import org.apache.olingo.odata2.api.ODataService;
+import org.apache.olingo.odata2.api.ODataServiceFactory;
+import org.apache.olingo.odata2.api.commons.HttpStatusCodes;
+import org.apache.olingo.odata2.api.ep.EntityProvider;
+import org.apache.olingo.odata2.api.exception.ODataApplicationException;
+import org.apache.olingo.odata2.api.exception.ODataException;
+import org.apache.olingo.odata2.api.processor.ODataContext;
+import org.apache.olingo.odata2.api.processor.ODataErrorCallback;
+import org.apache.olingo.odata2.api.processor.ODataErrorContext;
+import org.apache.olingo.odata2.api.processor.ODataResponse;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ *
+ */
+public class AnnotationSampleServiceFactory extends ODataServiceFactory {
+
+ /**
+ * Instance holder for all annotation relevant instances which should be used as singleton
+ * instances within the ODataApplication (ODataService)
+ */
+ private static class AnnotationInstances {
+ final static String MODEL_PACKAGE = "${package}.model";
+ final static ODataService ANNOTATION_ODATA_SERVICE;
+
+ static {
+ try {
+ ANNOTATION_ODATA_SERVICE = AnnotationServiceFactory.createAnnotationService(MODEL_PACKAGE);
+ initializeSampleData();
+ } catch (ODataApplicationException ex) {
+ throw new RuntimeException("Exception during sample data generation.", ex);
+ } catch (ODataException ex) {
+ throw new RuntimeException("Exception during data source initialization generation.", ex);
+ }
+ }
+ }
+
+ @Override
+ public ODataService createService(final ODataContext context) throws ODataException {
+ // Edm via Annotations and ListProcessor via AnnotationDS with AnnotationsValueAccess
+ return AnnotationInstances.ANNOTATION_ODATA_SERVICE;
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public <T extends ODataCallback> T getCallback(final Class<? extends ODataCallback> callbackInterface) {
+ return (T) (callbackInterface.isAssignableFrom(ScenarioErrorCallback.class)
+ ? new ScenarioErrorCallback() : callbackInterface.isAssignableFrom(ODataDebugCallback.class)
+ ? new ScenarioDebugCallback() : super.getCallback(callbackInterface));
+ }
+
+ /*
+ * Helper classes and methods
+ */
+ private final class ScenarioDebugCallback implements ODataDebugCallback {
+
+ @Override
+ public boolean isDebugEnabled() {
+ return true;
+ }
+ }
+
+ private class ScenarioErrorCallback implements ODataErrorCallback {
+
+ private final Logger LOG = LoggerFactory.getLogger(ScenarioErrorCallback.class);
+
+ @Override
+ public ODataResponse handleError(final ODataErrorContext context) throws ODataApplicationException {
+ if (context.getHttpStatus() == HttpStatusCodes.INTERNAL_SERVER_ERROR) {
+ LOG.error("Internal Server Error", context.getException());
+ }
+
+ return EntityProvider.writeErrorDocument(context);
+ }
+
+ }
+
+ private static <T> DataStore<T> getDataStore(Class<T> clz) throws DataStore.DataStoreException {
+ return DataStore.createInMemory(clz, true);
+ }
+
+ private static void initializeSampleData() throws ODataApplicationException {
+ DataStore<Car> carDs = getDataStore(Car.class);
+ Calendar updated = Calendar.getInstance();
+ Car c1 = createCar("F1 W02", 167189.00, 2011, updated);
+ carDs.create(c1);
+ Car c2 = createCar("F1 W04", 242189.99, 2013, updated);
+ carDs.create(c2);
+ Car c3 = createCar("FF2013", 199189.11, 2013, updated);
+ carDs.create(c3);
+ Car c4 = createCar("FF2014", 299189.11, 2014, updated);
+ carDs.create(c4);
+
+ DataStore<Driver> driverDs = getDataStore(Driver.class);
+ Driver d1 = createDriver("Mic", "Shoemaker", "The Fast", createDateTime(1985, 6, 27), c1);
+ driverDs.create(d1);
+ Driver d2 = createDriver("Nico", "Mulemountain", null, createDateTime(1969, 1, 3), c2);
+ driverDs.create(d2);
+ Driver d3 = createDriver("Kimi", "Heikkinen", "Iceman", createDateTime(1979, 10, 17), c3);
+ driverDs.create(d3);
+
+ Address addressStar = createAddress("Star Street 137", "Stuttgart", "70173", "Germany");
+ Manufacturer manStar = createManufacturer("Star Powered Racing", addressStar, createDateTime(1954, 7, 4), c1, c2);
+
+ Address addressHorse = createAddress("Horse Street 1", "Maranello", "41053", "Italy");
+ Manufacturer manHorse = createManufacturer("Horse Powered Racing", addressHorse, createDateTime(1929, 11, 16), c3, c4);
+
+ DataStore<Manufacturer> manDs = getDataStore(Manufacturer.class);
+ manDs.create(manStar);
+ manDs.create(manHorse);
+ }
+
+ private static Calendar createDateTime(int year, int month, int day) {
+ Calendar cal = Calendar.getInstance(Locale.ENGLISH);
+ cal.clear();
+ cal.set(year, month - 1, day);
+ return cal;
+ }
+
+ private static Car createCar(String name, double price, int modelyear, Calendar updated) {
+ Car car = new Car();
+ car.setModel(name);
+ car.setModelYear(modelyear);
+ car.setPrice(price);
+ car.setUpdated(updated.getTime());
+ return car;
+ }
+
+ private static Driver createDriver(String name, String lastname, String nickname, Calendar birthday, Car car) {
+ Driver driver = new Driver();
+ driver.setName(name);
+ driver.setLastname(lastname);
+ driver.setNickname(nickname);
+ driver.setBirthday(birthday);
+ driver.setCar(car);
+ car.setDriver(driver);
+ return driver;
+ }
+
+ private static Manufacturer createManufacturer(String name, Address address, Calendar founded, Car... cars) {
+ Manufacturer m = new Manufacturer();
+ m.setName(name);
+ m.setAddress(address);
+ m.setFounded(founded);
+ for (Car car : cars) {
+ car.setManufacturer(m);
+ m.getCars().add(car);
+ }
+ return m;
+ }
+
+ private static Address createAddress(final String street, final String city, final String zipCode,
+ final String country) {
+ Address address = new Address();
+ address.setStreet(street);
+ address.setCity(city);
+ address.setZipCode(zipCode);
+ address.setCountry(country);
+ return address;
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/17a1b04f/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/resources/log4j.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/resources/log4j.xml b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/resources/log4j.xml
new file mode 100644
index 0000000..6e3ec59
--- /dev/null
+++ b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/resources/log4j.xml
@@ -0,0 +1,47 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<!DOCTYPE log4j:configuration SYSTEM "http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/xml/doc-files/log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+ <appender name="console" class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out" />
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%-5p %c{1} - %m%n" />
+ </layout>
+ </appender>
+
+ <logger name="${package}" additivity="false">
+ <level value="trace" />
+ <appender-ref ref="console" />
+ </logger>
+
+ <logger name="org.apache.olingo.odata2" additivity="false">
+ <level value="debug" />
+ <appender-ref ref="console" />
+ </logger>
+
+ <root>
+ <priority value="error" />
+ <appender-ref ref="console" />
+ </root>
+</log4j:configuration>
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/17a1b04f/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/version/version.html
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/version/version.html b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/version/version.html
new file mode 100644
index 0000000..512ae83
--- /dev/null
+++ b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/version/version.html
@@ -0,0 +1,29 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<table border="1">
+ <tr><td>name</td><td>${symbol_dollar}{name}</td></tr>
+ <tr><td>version</td><td>${symbol_dollar}{version}</td></tr>
+ <tr><td>timestamp</td><td>${symbol_dollar}{timestamp}</td></tr>
+ <tr><td>project.build.finalName</td><td>${symbol_dollar}{project.build.finalName}</td></tr>
+</table>
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/17a1b04f/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
new file mode 100644
index 0000000..1a22906
--- /dev/null
+++ b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,51 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ id="WebApp_ID" version="2.5">
+ <display-name>${package}</display-name>
+ <welcome-file-list>
+ <welcome-file>index.jsp</welcome-file>
+ </welcome-file-list>
+
+ <servlet>
+ <servlet-name>CarServiceServlet</servlet-name>
+ <servlet-class>org.apache.cxf.jaxrs.servlet.CXFNonSpringJaxrsServlet</servlet-class>
+ <init-param>
+ <param-name>javax.ws.rs.Application</param-name>
+ <param-value>org.apache.olingo.odata2.core.rest.app.ODataApplication</param-value>
+ </init-param>
+ <init-param>
+ <param-name>org.apache.olingo.odata2.service.factory</param-name>
+ <param-value>${package}.processor.AnnotationSampleServiceFactory</param-value>
+ </init-param>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>CarServiceServlet</servlet-name>
+ <url-pattern>/MyFormula.svc/*</url-pattern>
+ </servlet-mapping>
+
+</web-app>
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/17a1b04f/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/webapp/index.jsp
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/webapp/index.jsp b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/webapp/index.jsp
new file mode 100644
index 0000000..b6f892d
--- /dev/null
+++ b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/webapp/index.jsp
@@ -0,0 +1,115 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<%@ page language="java" contentType="text/html; UTF-8" pageEncoding="UTF-8"%>
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<title>Apache Olingo - OData2 Library</title>
+<style type="text/css">
+body { font-family: Arial, sans-serif; font-size: 13px; line-height: 18px;
+ color: blue; background-color: ${symbol_pound}ffffff; }
+a { color: blue; text-decoration: none; }
+a:focus { outline: thin dotted ${symbol_pound}4076cb; outline-offset: -1px; }
+a:hover, a:active { outline: 0; }
+a:hover { color: ${symbol_pound}404a7e; text-decoration: underline; }
+h1, h2, h3, h4, h5, h6 { margin: 9px 0; font-family: inherit; font-weight: bold;
+ line-height: 1; color: blue; }
+h1 { font-size: 36px; line-height: 40px; }
+h2 { font-size: 30px; line-height: 40px; }
+h3 { font-size: 24px; line-height: 40px; }
+h4 { font-size: 18px; line-height: 20px; }
+h5 { font-size: 14px; line-height: 20px; }
+h6 { font-size: 12px; line-height: 20px; }
+.logo { float: right; }
+ul { padding: 0; margin: 0 0 9px 25px; }
+ul ul { margin-bottom: 0; }
+li { line-height: 18px; }
+hr { margin: 18px 0;
+ border: 0; border-top: 1px solid ${symbol_pound}cccccc; border-bottom: 1px solid ${symbol_pound}ffffff; }
+table { border-collapse: collapse; border-spacing: 10px; }
+th, td { border: 1px solid; padding: 20px; }
+.code { font-family: "Courier New", monospace; font-size: 13px; line-height: 18px; }
+</style>
+</head>
+<body>
+ <h1>Apache Olingo - OData2 Library</h1>
+ <hr />
+ <h2>Reference Scenario</h2>
+ <table>
+ <tr>
+ <td valign="top">
+ <h3>Service Document and Metadata</h3>
+ <ul>
+ <li><a href="MyFormula.svc?_wadl" target="_blank">wadl</a></li>
+ <li><a href="MyFormula.svc/" target="_blank">service document</a></li>
+ <li><a href="MyFormula.svc/${symbol_dollar}metadata" target="_blank">metadata</a></li>
+ </ul>
+ <h3>EntitySets</h3>
+ <ul>
+ <li><a href="MyFormula.svc/Manufacturers" target="_blank">Manufacturers</a></li>
+ <li><a href="MyFormula.svc/Manufacturers/?${symbol_dollar}expand=Cars" target="_blank">Manufacturers/?${symbol_dollar}expand=Cars</a></li>
+ <li><a href="MyFormula.svc/Cars" target="_blank">Cars</a></li>
+ <li><a href="MyFormula.svc/Cars/?${symbol_dollar}expand=Driver" target="_blank">Cars/?${symbol_dollar}expand=Driver</a></li>
+ <li><a href="MyFormula.svc/Drivers" target="_blank">Drivers</a></li>
+ <li><a href="MyFormula.svc/Drivers/?${symbol_dollar}expand=Car" target="_blank">Drivers/?${symbol_dollar}expand=Car</a></li>
+ <li><a href="MyFormula.svc/Drivers/?${symbol_dollar}orderby=Lastname" target="_blank">Drivers/?${symbol_dollar}orderby=Lastname</a></li>
+ <li><a href="MyFormula.svc/Drivers/?${symbol_dollar}filter=year(Birthday)%20gt%201981" target="_blank">Drivers/?${symbol_dollar}filter=year(Birthday) gt 1981</a></li>
+ </ul>
+ <h3>Entities</h3>
+ <ul>
+ <li><a href="MyFormula.svc/Manufacturers('1')" target="_blank">Manufacturers('1')</a></li>
+ <li><a href="MyFormula.svc/Manufacturers('1')/Cars" target="_blank">Manufacturers('1')/Cars</a></li>
+ <li><a href="MyFormula.svc/Cars('1')" target="_blank">Cars('1')</a></li>
+ <li><a href="MyFormula.svc/Cars('1')/Driver" target="_blank">Cars('1')/Driver</a></li>
+ <li><a href="MyFormula.svc/Cars('1')/?${symbol_dollar}expand=Manufacturer" target="_blank">Cars('1')/?${symbol_dollar}expand=Manufacturer</a></li>
+ <li><a href="MyFormula.svc/Drivers(1)" target="_blank">Drivers(1)</a></li>
+ <li><a href="MyFormula.svc/Drivers(1)/Car" target="_blank">Drivers(1)/Car</a></li>
+ </ul>
+ </td>
+ <td valign="top">
+
+ </td>
+ <td valign="bottom">
+ <div class="code">
+ <%
+ String version = "gen/version.html";
+ %>
+ <%
+ try {
+ %>
+ <jsp:include page='<%=version%>' />
+ <%
+ } catch (Exception e) {
+ %>
+ <p>IDE Build</p>
+ <%
+ }
+ %>
+ </div>
+ </td>
+ </tr>
+ </table>
+</body>
+</html>
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/17a1b04f/odata2-sample/cars-annotation-archetype/src/test/resources/projects/basic/archetype.properties
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/src/test/resources/projects/basic/archetype.properties b/odata2-sample/cars-annotation-archetype/src/test/resources/projects/basic/archetype.properties
new file mode 100644
index 0000000..5bb9a2b
--- /dev/null
+++ b/odata2-sample/cars-annotation-archetype/src/test/resources/projects/basic/archetype.properties
@@ -0,0 +1,5 @@
+#Thu Jan 09 06:21:45 CET 2014
+package=it.pkg
+version=0.1-SNAPSHOT
+groupId=archetype.it
+artifactId=basic
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/17a1b04f/odata2-sample/cars-annotation-archetype/src/test/resources/projects/basic/goal.txt
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/src/test/resources/projects/basic/goal.txt b/odata2-sample/cars-annotation-archetype/src/test/resources/projects/basic/goal.txt
new file mode 100644
index 0000000..e69de29
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/17a1b04f/odata2-sample/pom.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/pom.xml b/odata2-sample/pom.xml
index 576d4f0..8082976 100644
--- a/odata2-sample/pom.xml
+++ b/odata2-sample/pom.xml
@@ -23,5 +23,6 @@
<modules>
<module>cars-service-archetype</module>
+ <module>cars-annotation-archetype</module>
</modules>
</project>
[11/12] git commit: [OLINGO-88] Removed not used 'version.html'
Posted by sk...@apache.org.
[OLINGO-88] Removed not used 'version.html'
Project: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/commit/171352a1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/tree/171352a1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/diff/171352a1
Branch: refs/heads/olingo-117
Commit: 171352a1061b513f51982aae5d04e42dae6d9368
Parents: 58b6118
Author: Michael Bolz <mi...@apache.org>
Authored: Tue Jan 14 08:48:09 2014 +0100
Committer: Stephan Klevenz <sk...@apache.org>
Committed: Tue Jan 14 12:24:44 2014 +0100
----------------------------------------------------------------------
.../META-INF/maven/archetype-metadata.xml | 9 +-
.../src/main/version/version.html | 29 ------
.../src/main/webapp/index.jsp | 104 +++++++------------
3 files changed, 43 insertions(+), 99 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/171352a1/odata2-sample/cars-annotation-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml b/odata2-sample/cars-annotation-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
index 10d3ba2..5a10f46 100644
--- a/odata2-sample/cars-annotation-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
+++ b/odata2-sample/cars-annotation-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml
@@ -14,6 +14,9 @@
<requiredProperty key="version">
<defaultValue>1.0.0-SNAPSHOT</defaultValue>
</requiredProperty>
+ <requiredProperty key="package">
+ <defaultValue>org.apache.olingo.sample.annotation</defaultValue>
+ </requiredProperty>
</requiredProperties>
<fileSets>
<fileSet filtered="true" packaged="true" encoding="UTF-8">
@@ -23,12 +26,6 @@
</includes>
</fileSet>
<fileSet filtered="true" encoding="UTF-8">
- <directory>src/main/version</directory>
- <includes>
- <include>**/*.html</include>
- </includes>
- </fileSet>
- <fileSet filtered="true" encoding="UTF-8">
<directory>src/main/webapp</directory>
<includes>
<include>**/*.jsp</include>
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/171352a1/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/version/version.html
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/version/version.html b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/version/version.html
deleted file mode 100644
index 512ae83..0000000
--- a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/version/version.html
+++ /dev/null
@@ -1,29 +0,0 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-<table border="1">
- <tr><td>name</td><td>${symbol_dollar}{name}</td></tr>
- <tr><td>version</td><td>${symbol_dollar}{version}</td></tr>
- <tr><td>timestamp</td><td>${symbol_dollar}{timestamp}</td></tr>
- <tr><td>project.build.finalName</td><td>${symbol_dollar}{project.build.finalName}</td></tr>
-</table>
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/171352a1/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/webapp/index.jsp
----------------------------------------------------------------------
diff --git a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/webapp/index.jsp b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/webapp/index.jsp
index b6f892d..1d43be0 100644
--- a/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/webapp/index.jsp
+++ b/odata2-sample/cars-annotation-archetype/src/main/resources/archetype-resources/src/main/webapp/index.jsp
@@ -1,6 +1,3 @@
-#set( $symbol_pound = '#' )
-#set( $symbol_dollar = '$' )
-#set( $symbol_escape = '\' )
<!--
Licensed to the Apache Software Foundation (ASF) under one
@@ -29,11 +26,11 @@
<title>Apache Olingo - OData2 Library</title>
<style type="text/css">
body { font-family: Arial, sans-serif; font-size: 13px; line-height: 18px;
- color: blue; background-color: ${symbol_pound}ffffff; }
+ color: blue; background-color: #ffffff; }
a { color: blue; text-decoration: none; }
-a:focus { outline: thin dotted ${symbol_pound}4076cb; outline-offset: -1px; }
+a:focus { outline: thin dotted #4076cb; outline-offset: -1px; }
a:hover, a:active { outline: 0; }
-a:hover { color: ${symbol_pound}404a7e; text-decoration: underline; }
+a:hover { color: #404a7e; text-decoration: underline; }
h1, h2, h3, h4, h5, h6 { margin: 9px 0; font-family: inherit; font-weight: bold;
line-height: 1; color: blue; }
h1 { font-size: 36px; line-height: 40px; }
@@ -47,69 +44,48 @@ ul { padding: 0; margin: 0 0 9px 25px; }
ul ul { margin-bottom: 0; }
li { line-height: 18px; }
hr { margin: 18px 0;
- border: 0; border-top: 1px solid ${symbol_pound}cccccc; border-bottom: 1px solid ${symbol_pound}ffffff; }
+ border: 0; border-top: 1px solid #cccccc; border-bottom: 1px solid #ffffff; }
table { border-collapse: collapse; border-spacing: 10px; }
th, td { border: 1px solid; padding: 20px; }
.code { font-family: "Courier New", monospace; font-size: 13px; line-height: 18px; }
</style>
</head>
<body>
- <h1>Apache Olingo - OData2 Library</h1>
- <hr />
- <h2>Reference Scenario</h2>
- <table>
- <tr>
- <td valign="top">
- <h3>Service Document and Metadata</h3>
- <ul>
- <li><a href="MyFormula.svc?_wadl" target="_blank">wadl</a></li>
- <li><a href="MyFormula.svc/" target="_blank">service document</a></li>
- <li><a href="MyFormula.svc/${symbol_dollar}metadata" target="_blank">metadata</a></li>
- </ul>
- <h3>EntitySets</h3>
- <ul>
- <li><a href="MyFormula.svc/Manufacturers" target="_blank">Manufacturers</a></li>
- <li><a href="MyFormula.svc/Manufacturers/?${symbol_dollar}expand=Cars" target="_blank">Manufacturers/?${symbol_dollar}expand=Cars</a></li>
- <li><a href="MyFormula.svc/Cars" target="_blank">Cars</a></li>
- <li><a href="MyFormula.svc/Cars/?${symbol_dollar}expand=Driver" target="_blank">Cars/?${symbol_dollar}expand=Driver</a></li>
- <li><a href="MyFormula.svc/Drivers" target="_blank">Drivers</a></li>
- <li><a href="MyFormula.svc/Drivers/?${symbol_dollar}expand=Car" target="_blank">Drivers/?${symbol_dollar}expand=Car</a></li>
- <li><a href="MyFormula.svc/Drivers/?${symbol_dollar}orderby=Lastname" target="_blank">Drivers/?${symbol_dollar}orderby=Lastname</a></li>
- <li><a href="MyFormula.svc/Drivers/?${symbol_dollar}filter=year(Birthday)%20gt%201981" target="_blank">Drivers/?${symbol_dollar}filter=year(Birthday) gt 1981</a></li>
- </ul>
- <h3>Entities</h3>
- <ul>
- <li><a href="MyFormula.svc/Manufacturers('1')" target="_blank">Manufacturers('1')</a></li>
- <li><a href="MyFormula.svc/Manufacturers('1')/Cars" target="_blank">Manufacturers('1')/Cars</a></li>
- <li><a href="MyFormula.svc/Cars('1')" target="_blank">Cars('1')</a></li>
- <li><a href="MyFormula.svc/Cars('1')/Driver" target="_blank">Cars('1')/Driver</a></li>
- <li><a href="MyFormula.svc/Cars('1')/?${symbol_dollar}expand=Manufacturer" target="_blank">Cars('1')/?${symbol_dollar}expand=Manufacturer</a></li>
- <li><a href="MyFormula.svc/Drivers(1)" target="_blank">Drivers(1)</a></li>
- <li><a href="MyFormula.svc/Drivers(1)/Car" target="_blank">Drivers(1)/Car</a></li>
- </ul>
- </td>
- <td valign="top">
-
- </td>
- <td valign="bottom">
- <div class="code">
- <%
- String version = "gen/version.html";
- %>
- <%
- try {
- %>
- <jsp:include page='<%=version%>' />
- <%
- } catch (Exception e) {
- %>
- <p>IDE Build</p>
- <%
- }
- %>
- </div>
- </td>
- </tr>
- </table>
+ <h1>Apache Olingo - OData2 Library</h1>
+ <hr />
+ <h2>Cars Annotation Service</h2>
+ <table>
+ <tr>
+ <td valign="top">
+ <h3>Service Document and Metadata</h3>
+ <ul>
+ <li><a href="MyFormula.svc?_wadl" target="_blank">wadl</a></li>
+ <li><a href="MyFormula.svc/" target="_blank">service document</a></li>
+ <li><a href="MyFormula.svc/$metadata" target="_blank">metadata</a></li>
+ </ul>
+ <h3>EntitySets</h3>
+ <ul>
+ <li><a href="MyFormula.svc/Manufacturers" target="_blank">Manufacturers</a></li>
+ <li><a href="MyFormula.svc/Manufacturers/?$expand=Cars" target="_blank">Manufacturers/?$expand=Cars</a></li>
+ <li><a href="MyFormula.svc/Cars" target="_blank">Cars</a></li>
+ <li><a href="MyFormula.svc/Cars/?$expand=Driver" target="_blank">Cars/?$expand=Driver</a></li>
+ <li><a href="MyFormula.svc/Drivers" target="_blank">Drivers</a></li>
+ <li><a href="MyFormula.svc/Drivers/?$expand=Car" target="_blank">Drivers/?$expand=Car</a></li>
+ <li><a href="MyFormula.svc/Drivers/?$orderby=Lastname" target="_blank">Drivers/?$orderby=Lastname</a></li>
+ <li><a href="MyFormula.svc/Drivers/?$filter=year(Birthday)%20gt%201981" target="_blank">Drivers/?$filter=year(Birthday) gt 1981</a></li>
+ </ul>
+ <h3>Entities</h3>
+ <ul>
+ <li><a href="MyFormula.svc/Manufacturers('1')" target="_blank">Manufacturers('1')</a></li>
+ <li><a href="MyFormula.svc/Manufacturers('1')/Cars" target="_blank">Manufacturers('1')/Cars</a></li>
+ <li><a href="MyFormula.svc/Cars('1')" target="_blank">Cars('1')</a></li>
+ <li><a href="MyFormula.svc/Cars('1')/Driver" target="_blank">Cars('1')/Driver</a></li>
+ <li><a href="MyFormula.svc/Cars('1')/?$expand=Manufacturer" target="_blank">Cars('1')/?$expand=Manufacturer</a></li>
+ <li><a href="MyFormula.svc/Drivers(1)" target="_blank">Drivers(1)</a></li>
+ <li><a href="MyFormula.svc/Drivers(1)/Car" target="_blank">Drivers(1)/Car</a></li>
+ </ul>
+ </td>
+ </tr>
+ </table>
</body>
</html>
[OLINGO-116] Added fix
Project: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/commit/58b61188
Tree: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/tree/58b61188
Diff: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/diff/58b61188
Branch: refs/heads/olingo-117
Commit: 58b6118864ac329daf5487c5fa67a9ac2815f1f7
Parents: ae15d1d
Author: Michael Bolz <mi...@apache.org>
Authored: Mon Jan 13 13:48:54 2014 +0100
Committer: Stephan Klevenz <sk...@apache.org>
Committed: Tue Jan 14 12:24:44 2014 +0100
----------------------------------------------------------------------
.../processor/core/util/ClassHelper.java | 60 +++++++++++++-------
1 file changed, 38 insertions(+), 22 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/58b61188/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/util/ClassHelper.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/util/ClassHelper.java b/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/util/ClassHelper.java
index 006adb4..27f9cdb 100644
--- a/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/util/ClassHelper.java
+++ b/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/util/ClassHelper.java
@@ -39,9 +39,9 @@ import org.apache.olingo.odata2.core.exception.ODataRuntimeException;
*/
public class ClassHelper {
- private static final String JAR_FILE_ENDING = "jar!";
+ private static final String JAR_FILE_ENDING = "jar";
private static final String JAR_RESOURCE_SEPARATOR = "!";
- private static final char PATH_SEPARATOR = '/';
+ private static final char RESOURCE_SEPARATOR = '/';
private static final char PACKAGE_SEPARATOR = '.';
private static final File[] EMPTY_FILE_ARRAY = new File[0];
private static final String CLASSFILE_ENDING = ".class";
@@ -67,18 +67,20 @@ public class ClassHelper {
public static final List<Class<?>> loadClasses(final String packageToScan, final FilenameFilter ff,
final ClassValidator cv) {
final ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
- String folderToScan = packageToScan.replace(PACKAGE_SEPARATOR, PATH_SEPARATOR);
+ String folderToScan = packageToScan.replace(PACKAGE_SEPARATOR, RESOURCE_SEPARATOR);
URL url = classLoader.getResource(folderToScan);
if (url == null) {
throw new IllegalArgumentException("No folder to scan found for package '" + packageToScan + "'.");
}
final Collection<String> fqnForClasses;
- if (url.getFile().contains(JAR_FILE_ENDING)) {
- fqnForClasses = getClassFqnFromJar(url.getFile().substring(5));
- } else {
- File folder = new File(url.getFile());
+ File folder = new File(url.getFile());
+ if (folder.isDirectory()) {
fqnForClasses = getClassFqnFromDir(ff, folder, packageToScan);
+ } else if (isJarFile(url)) {
+ fqnForClasses = getClassFqnFromJar(url.getFile().substring(5), packageToScan);
+ } else {
+ fqnForClasses = null;
}
if (fqnForClasses == null || fqnForClasses.isEmpty()) {
@@ -94,6 +96,7 @@ public class ClassHelper {
}
} catch (ClassNotFoundException ex) {
throw new IllegalArgumentException("Exception during class loading of class '" + fqn +
+ " from resource '" + url.getFile() + "'" +
"' with message '" + ex.getMessage() + "'.");
}
}
@@ -101,6 +104,16 @@ public class ClassHelper {
return annotatedClasses;
}
+ private static boolean isJarFile(URL url) {
+ String filename = url.getFile();
+ int index = filename.indexOf(JAR_RESOURCE_SEPARATOR);
+ if (index > JAR_FILE_ENDING.length()) {
+ String fileEnding = filename.substring(index - JAR_FILE_ENDING.length(), index);
+ return JAR_FILE_ENDING.equalsIgnoreCase(fileEnding);
+ }
+ return false;
+ }
+
private static Collection<String> getClassFqnFromDir(final FilenameFilter ff, File folder, String packageToScan) {
List<String> classFiles = new ArrayList<String>();
String[] classFilesForFolder = folder.list(ff);
@@ -117,33 +130,28 @@ public class ClassHelper {
return classFiles;
}
- private static Collection<String> getClassFqnFromJar(String filepath) {
+ private static Collection<String> getClassFqnFromJar(String filepath, String packageToScan) {
+ JarFile jarFile = null;
+
+ final String jarFilePath;
String[] split = filepath.split(JAR_RESOURCE_SEPARATOR);
if (split.length == 2) {
- return getClassFilesFromJar(split[0], split[1]);
+ jarFilePath = split[0];
+ } else {
+ throw new IllegalArgumentException("Illegal jar file path '" + filepath + "'.");
}
- throw new IllegalArgumentException("Illegal jar file path '" + filepath + "'.");
- }
- private static Collection<String> getClassFilesFromJar(String jarFilePath, String folderToScan) {
try {
- final String prefix;
- if (folderToScan.startsWith(File.separator)) {
- prefix = folderToScan.substring(1);
- } else {
- prefix = folderToScan;
- }
-
- JarFile jarFile = new JarFile(jarFilePath);
+ jarFile = new JarFile(jarFilePath);
List<String> classFileNames = new ArrayList<String>();
Enumeration<JarEntry> entries = jarFile.entries();
while (entries.hasMoreElements()) {
JarEntry je = entries.nextElement();
String name = je.getName();
- if (!je.isDirectory() && name.endsWith(CLASSFILE_ENDING) && name.startsWith(prefix)) {
+ if (!je.isDirectory() && name.matches(".*" + packageToScan + ".*" + CLASSFILE_ENDING)) {
String className = name.substring(0, name.length() - CLASSFILE_ENDING.length());
- classFileNames.add(className.replace(PATH_SEPARATOR, PACKAGE_SEPARATOR));
+ classFileNames.add(className.replace(RESOURCE_SEPARATOR, PACKAGE_SEPARATOR));
}
}
@@ -151,6 +159,14 @@ public class ClassHelper {
} catch (IOException e) {
throw new IllegalArgumentException("Exception during class loading from path '" + jarFilePath +
"' with message '" + e.getMessage() + "'.");
+ } finally {
+ if (jarFile != null) {
+ try {
+ jarFile.close();
+ } catch (IOException e) {
+ throw new RuntimeException("Error during close of jar file: " + jarFile.getName() + "", e);
+ }
+ }
}
}
[08/12] git commit: [OLINGO-49],
[OLINGO-51] Support for A) Linking entities using tag within
an OData Entry B) Updating links C) Deleting links D) Code Cleanup
Added missing licence header
Project: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/commit/faf0709c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/tree/faf0709c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/diff/faf0709c
Branch: refs/heads/olingo-117
Commit: faf0709ca778ffe3a9ea4c0713e802e7946f07b9
Parents: 352f541
Author: Michael Bolz <mi...@apache.org>
Authored: Mon Jan 13 07:50:43 2014 +0100
Committer: Stephan Klevenz <sk...@apache.org>
Committed: Tue Jan 14 12:24:43 2014 +0100
----------------------------------------------------------------------
.../jpa/processor/core/ODataEntityParserTest.java | 18 ++++++++++++++++++
.../processor/core/access/data/JPALinkTest.java | 18 ++++++++++++++++++
2 files changed, 36 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/faf0709c/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/ODataEntityParserTest.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/ODataEntityParserTest.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/ODataEntityParserTest.java
index 93587a8..adf7b80 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/ODataEntityParserTest.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/ODataEntityParserTest.java
@@ -1,3 +1,21 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
package org.apache.olingo.odata2.jpa.processor.core;
import static org.junit.Assert.assertEquals;
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/faf0709c/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPALinkTest.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPALinkTest.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPALinkTest.java
index db0f6fb..7a0b754 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPALinkTest.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/access/data/JPALinkTest.java
@@ -1,3 +1,21 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
package org.apache.olingo.odata2.jpa.processor.core.access.data;
public class JPALinkTest {
[04/12] git commit: [OLINGO-113] Fixed null compare and added tests
Posted by sk...@apache.org.
[OLINGO-113] Fixed null compare and added tests
Project: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/commit/42290ba6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/tree/42290ba6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/diff/42290ba6
Branch: refs/heads/olingo-117
Commit: 42290ba604a43761820583fb1485b12b3671330b
Parents: 3c327f2
Author: Michael Bolz <mi...@apache.org>
Authored: Thu Jan 9 13:30:21 2014 +0100
Committer: Stephan Klevenz <sk...@apache.org>
Committed: Tue Jan 14 12:24:42 2014 +0100
----------------------------------------------------------------------
.../core/datasource/AnnotationInMemoryDs.java | 49 +++++++++++++++--
.../datasource/AnnotationsInMemoryDsTest.java | 58 ++++++++++++++++++++
2 files changed, 101 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/42290ba6/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/datasource/AnnotationInMemoryDs.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/datasource/AnnotationInMemoryDs.java b/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/datasource/AnnotationInMemoryDs.java
index b389fa4..2f8fa10 100644
--- a/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/datasource/AnnotationInMemoryDs.java
+++ b/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/datasource/AnnotationInMemoryDs.java
@@ -17,10 +17,12 @@ package org.apache.olingo.odata2.annotation.processor.core.datasource;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Collection;
+import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import org.apache.olingo.odata2.annotation.processor.core.datasource.DataStore.DataStoreException;
import org.apache.olingo.odata2.annotation.processor.core.util.AnnotationHelper;
import org.apache.olingo.odata2.annotation.processor.core.util.AnnotationHelper.AnnotatedNavInfo;
import org.apache.olingo.odata2.annotation.processor.core.util.AnnotationHelper.ODataAnnotationException;
@@ -44,11 +46,11 @@ public class AnnotationInMemoryDs implements DataSource {
private final Map<String, DataStore<Object>> dataStores = new HashMap<String, DataStore<Object>>();
private final boolean persistInMemory;
- public AnnotationInMemoryDs(Collection<Class<?>> annotatedClasses) throws ODataException {
+ public AnnotationInMemoryDs(final Collection<Class<?>> annotatedClasses) throws ODataException {
this(annotatedClasses, true);
}
- public AnnotationInMemoryDs(Collection<Class<?>> annotatedClasses, boolean persistInMemory) throws ODataException {
+ public AnnotationInMemoryDs(final Collection<Class<?>> annotatedClasses, final boolean persistInMemory) throws ODataException {
this.persistInMemory = persistInMemory;
init(annotatedClasses);
}
@@ -82,6 +84,7 @@ public class AnnotationInMemoryDs implements DataSource {
}
}
+ @SuppressWarnings("unchecked")
public <T> DataStore<T> getDataStore(final Class<T> clazz) {
String entitySetName = ANNOTATION_HELPER.extractEntitySetName(clazz);
return (DataStore<T>) dataStores.get(entitySetName);
@@ -141,7 +144,26 @@ public class AnnotationInMemoryDs implements DataSource {
+ "', targetStore='" + targetStore + "').");
}
+ List<Object> resultData = readResultData(targetStore, sourceData, sourceField);
+ return extractResultData(targetStore, targetKeys, navInfo, resultData);
+ }
+
+ /**
+ * Read the result data from the target store based on <code>sourceData</code> and <code>sourceField</code>
+ *
+ * @param targetStore
+ * @param sourceData
+ * @param sourceField
+ * @return
+ * @throws DataStoreException
+ */
+ private List<Object> readResultData(final DataStore<?> targetStore, final Object sourceData, final Field sourceField)
+ throws DataStoreException {
Object navigationInstance = getValue(sourceField, sourceData);
+ if (navigationInstance == null) {
+ return Collections.emptyList();
+ }
+
List<Object> resultData = new ArrayList<Object>();
for (Object targetInstance : targetStore.read()) {
if (navigationInstance instanceof Collection) {
@@ -154,7 +176,22 @@ public class AnnotationInMemoryDs implements DataSource {
resultData.add(targetInstance);
}
}
+ return resultData;
+ }
+ /**
+ * Extract the <code>result data</code> from the <code>resultData</code> list based on
+ * <code>navigation information</code> and <code>targetKeys</code>.
+ *
+ * @param targetStore
+ * @param targetKeys
+ * @param navInfo
+ * @param resultData
+ * @return
+ * @throws DataStoreException
+ */
+ private Object extractResultData(final DataStore<?> targetStore, final Map<String, Object> targetKeys,
+ final AnnotatedNavInfo navInfo, final List<Object> resultData) throws DataStoreException {
if (navInfo.getToMultiplicity() == EdmMultiplicity.MANY) {
if (targetKeys.isEmpty()) {
return resultData;
@@ -183,15 +220,15 @@ public class AnnotationInMemoryDs implements DataSource {
Object data = ANNOTATION_HELPER.getValueForField(mediaLinkEntryData, EdmMediaResourceContent.class);
Object mimeType = ANNOTATION_HELPER.getValueForField(mediaLinkEntryData, EdmMediaResourceMimeType.class);
- if(data == null && mimeType == null) {
+ if (data == null && mimeType == null) {
DataStore<Object> dataStore = getDataStore(entitySet);
Object readEntry = dataStore.read(mediaLinkEntryData);
- if(readEntry != null) {
+ if (readEntry != null) {
data = ANNOTATION_HELPER.getValueForField(readEntry, EdmMediaResourceContent.class);
mimeType = ANNOTATION_HELPER.getValueForField(readEntry, EdmMediaResourceMimeType.class);
}
}
-
+
return new BinaryData((byte[]) data, String.valueOf(mimeType));
}
@@ -215,7 +252,7 @@ public class AnnotationInMemoryDs implements DataSource {
try {
DataStore<Object> dataStore = getDataStore(entitySet);
Object readEntry = dataStore.read(mediaEntityInstance);
- if(readEntry == null) {
+ if (readEntry == null) {
throw new ODataNotFoundException(ODataNotFoundException.ENTITY);
} else {
ANNOTATION_HELPER.setValueForAnnotatedField(
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/42290ba6/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/datasource/AnnotationsInMemoryDsTest.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/datasource/AnnotationsInMemoryDsTest.java b/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/datasource/AnnotationsInMemoryDsTest.java
index cff39b9..3213556 100644
--- a/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/datasource/AnnotationsInMemoryDsTest.java
+++ b/odata2-annotation-processor/annotation-processor-core/src/test/java/org/apache/olingo/odata2/annotation/processor/core/datasource/AnnotationsInMemoryDsTest.java
@@ -399,6 +399,64 @@ public class AnnotationsInMemoryDsTest {
}
@Test
+ @SuppressWarnings("unchecked")
+ public void readRelatedEntity() throws Exception {
+ EdmEntitySet buildingsEntitySet = createMockedEdmEntitySet("Buildings");
+ EdmEntitySet roomsEntitySet = createMockedEdmEntitySet("Rooms");
+
+ Building building = new Building();
+ building.setName("Common Building");
+
+ Room room = new Room(12, "Room 12");
+ room.setBuilding(building);
+ datasource.createData(roomsEntitySet, room);
+ datasource.createData(buildingsEntitySet, building);
+
+ Map<String, Object> keys = new HashMap<String, Object>();
+ keys.put("Id", Integer.valueOf(12));
+ Room read = (Room) datasource.readData(roomsEntitySet, keys);
+ Assert.assertEquals("Room 12", read.getName());
+ Assert.assertEquals("12", read.getId());
+
+ // execute
+ Object relatedData = datasource.readRelatedData(
+ roomsEntitySet, room, buildingsEntitySet, Collections.EMPTY_MAP);
+
+ // validate
+ Assert.assertTrue("Result is no room.", relatedData instanceof Building);
+ Building b = (Building) relatedData;
+ Assert.assertEquals("Common Building", b.getName());
+ }
+
+ @Test
+ @SuppressWarnings("unchecked")
+ public void readRelatedEntityWithNull() throws Exception {
+ EdmEntitySet buildingsEntitySet = createMockedEdmEntitySet("Buildings");
+ EdmEntitySet roomsEntitySet = createMockedEdmEntitySet("Rooms");
+
+ Building building = new Building();
+ building.setName("Common Building");
+ datasource.createData(buildingsEntitySet, building);
+
+ Room room = new Room(12, "Room 12");
+ room.setBuilding(null);
+ datasource.createData(roomsEntitySet, room);
+ //
+ Map<String, Object> keys = new HashMap<String, Object>();
+ keys.put("Id", Integer.valueOf(12));
+ Room read = (Room) datasource.readData(roomsEntitySet, keys);
+ Assert.assertEquals("Room 12", read.getName());
+ Assert.assertEquals("12", read.getId());
+
+ // execute
+ Object relatedData = datasource.readRelatedData(
+ roomsEntitySet, room, buildingsEntitySet, Collections.EMPTY_MAP);
+
+ // validate
+ Assert.assertNull("Related data must be null.", relatedData);
+ }
+
+ @Test
public void readRelatedTargetEntity() throws Exception {
EdmEntitySet buildingsEntitySet = createMockedEdmEntitySet("Buildings");
EdmEntitySet roomsEntitySet = createMockedEdmEntitySet("Rooms");
[OLINGO-117] deleted entries support]
Project: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/commit/0848b544
Tree: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/tree/0848b544
Diff: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/diff/0848b544
Branch: refs/heads/olingo-117
Commit: 0848b5448db49d097fb91f6339f81cfe6bc298db
Parents: 171352a
Author: Stephan Klevenz <sk...@apache.org>
Authored: Tue Jan 14 09:50:51 2014 +0100
Committer: Stephan Klevenz <sk...@apache.org>
Committed: Tue Jan 14 12:26:56 2014 +0100
----------------------------------------------------------------------
.../JsonDeletedEntryEntityProducer.java | 26 ++++++++-
.../JsonFeedWithDeltaLinkProducerTest.java | 57 ++++++++++++++++----
2 files changed, 72 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/0848b544/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/producer/JsonDeletedEntryEntityProducer.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/producer/JsonDeletedEntryEntityProducer.java b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/producer/JsonDeletedEntryEntityProducer.java
index 88f54f2..14baf52 100644
--- a/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/producer/JsonDeletedEntryEntityProducer.java
+++ b/odata2-lib/odata-core/src/main/java/org/apache/olingo/odata2/core/ep/producer/JsonDeletedEntryEntityProducer.java
@@ -1,3 +1,21 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
package org.apache.olingo.odata2.core.ep.producer;
import java.io.IOException;
@@ -25,6 +43,7 @@ public class JsonDeletedEntryEntityProducer {
try {
if (deletedEntries.size() > 0) {
jsonStreamWriter.separator();
+ int counter = 0;
for (Map<String, Object> deletedEntry : deletedEntries) {
jsonStreamWriter.beginObject();
@@ -35,8 +54,13 @@ public class JsonDeletedEntryEntityProducer {
jsonStreamWriter.namedStringValue(FormatJson.ODATA_CONTEXT, odataContextValue);
jsonStreamWriter.separator();
jsonStreamWriter.namedStringValue(FormatJson.ID, idValue);
-
jsonStreamWriter.endObject();
+
+ if (counter < deletedEntries.size()) {
+ jsonStreamWriter.separator();
+ }
+
+ counter++;
}
}
} catch (final IOException e) {
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/0848b544/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/producer/JsonFeedWithDeltaLinkProducerTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/producer/JsonFeedWithDeltaLinkProducerTest.java b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/producer/JsonFeedWithDeltaLinkProducerTest.java
index 03d7e0c..a3c5fc0 100644
--- a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/producer/JsonFeedWithDeltaLinkProducerTest.java
+++ b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/producer/JsonFeedWithDeltaLinkProducerTest.java
@@ -1,15 +1,33 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
package org.apache.olingo.odata2.core.ep.producer;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
import java.io.IOException;
import java.io.InputStream;
-import java.lang.reflect.Type;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.HashMap;
-import java.util.List;
import java.util.Map;
import org.apache.olingo.odata2.api.ODataCallback;
@@ -26,8 +44,6 @@ import org.junit.Before;
import org.junit.Test;
import com.google.gson.Gson;
-import com.google.gson.internal.StringMap;
-import com.google.gson.reflect.TypeToken;
public class JsonFeedWithDeltaLinkProducerTest extends BaseTest {
@@ -38,6 +54,8 @@ public class JsonFeedWithDeltaLinkProducerTest extends BaseTest {
private ArrayList<Map<String, Object>> deletedRoomData;
protected ArrayList<Map<String, Object>> roomsData;
+ private Gson gson = new Gson();
+
private void initializeRoomData() {
Map<String, Object> roomData1 = new HashMap<String, Object>();
roomData1.put("Id", "1");
@@ -55,7 +73,7 @@ public class JsonFeedWithDeltaLinkProducerTest extends BaseTest {
private void initializeDeletedRoomData() {
deletedRoomData = new ArrayList<Map<String, Object>>();
- for (int i = 2; i <= roomsData.size(); i = i + 2) {
+ for (int i = roomsData.size() + 1; i <= roomsData.size() + 1 + 2; i++) {
HashMap<String, Object> tmp = new HashMap<String, Object>();
tmp.put("Id", "" + i);
tmp.put("Name", "Neu Schwanstein" + i);
@@ -93,9 +111,7 @@ public class JsonFeedWithDeltaLinkProducerTest extends BaseTest {
final String json = writeRoomData(entitySet, tombstoneCallback);
- assertTrue("Somthing wring with @odata.context!", json
- .contains("{\"@odata.context\":\"$metadata#Rooms/$deletedEntity\",\""));
- System.out.println(json);
+ assertDeletedEntries(json);
}
@Test
@@ -109,8 +125,21 @@ public class JsonFeedWithDeltaLinkProducerTest extends BaseTest {
assertTrue("Delta Link missing or wrong!", json
.contains("__delta\":\"http://host:80/service/Rooms?!deltatoken=1234"));
- assertTrue("Somthing wring with @odata.context!", json
+ assertDeletedEntries(json);
+ }
+
+ private void assertDeletedEntries(final String json) {
+ assertTrue("Somthing wrong with @odata.context!", json
.contains("{\"@odata.context\":\"$metadata#Rooms/$deletedEntity\",\""));
+ assertTrue(
+ "Somthing wrong with deleted entry!",
+ json.contains("{\"@odata.context\":\"$metadata#Rooms/$deletedEntity\",\"id\":\"http://host:80/service/Rooms('3')\"}"));
+ assertTrue(
+ "Somthing wrong with deleted entry!",
+ json.contains("{\"@odata.context\":\"$metadata#Rooms/$deletedEntity\",\"id\":\"http://host:80/service/Rooms('4')\"}"));
+ assertTrue(
+ "Somthing wrong with deleted entry!",
+ json.contains("{\"@odata.context\":\"$metadata#Rooms/$deletedEntity\",\"id\":\"http://host:80/service/Rooms('5')\"}"));
}
private String writeRoomData(final EdmEntitySet entitySet, TombstoneCallback tombstoneCallback)
@@ -129,7 +158,15 @@ public class JsonFeedWithDeltaLinkProducerTest extends BaseTest {
final String json = StringHelper.inputStreamToString((InputStream) response.getEntity());
assertNotNull(json);
+
+ validate(json);
+
return json;
}
+ private void validate(String json) {
+ Object obj = gson.fromJson(json, Object.class);
+ assertNotNull(obj);
+ }
+
}
[06/12] git commit: [OLINGO-115] Junit test verified that it works
Posted by sk...@apache.org.
[OLINGO-115] Junit test verified that it works
Project: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/commit/ae15d1d0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/tree/ae15d1d0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/diff/ae15d1d0
Branch: refs/heads/olingo-117
Commit: ae15d1d05450a10892cdd349d042008c35e88b79
Parents: faf0709
Author: Christian Amend <ch...@apache.org>
Authored: Mon Jan 13 10:44:10 2014 +0100
Committer: Stephan Klevenz <sk...@apache.org>
Committed: Tue Jan 14 12:24:43 2014 +0100
----------------------------------------------------------------------
.../jpa/processor/core/ODataEntityParser.java | 3 +-
.../ep/ProducerConsumerIntegrationTest.java | 83 ++++++++++++++++++++
2 files changed, 85 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/ae15d1d0/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/ODataEntityParser.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/ODataEntityParser.java b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/ODataEntityParser.java
index dccfc6c..0da3bcd 100644
--- a/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/ODataEntityParser.java
+++ b/odata2-jpa-processor/jpa-core/src/main/java/org/apache/olingo/odata2/jpa/processor/core/ODataEntityParser.java
@@ -135,7 +135,8 @@ public final class ODataEntityParser {
return uriInfo;
}
- public UriInfo parseBindingLink(final String link, final Map<String, String> options) throws ODataJPARuntimeException {
+ public UriInfo parseBindingLink(final String link, final Map<String, String> options)
+ throws ODataJPARuntimeException {
final PathSegment pathSegment = getPathSegment(link);
UriInfo uriInfo = null;
try {
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/ae15d1d0/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/ProducerConsumerIntegrationTest.java
----------------------------------------------------------------------
diff --git a/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/ProducerConsumerIntegrationTest.java b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/ProducerConsumerIntegrationTest.java
new file mode 100644
index 0000000..e7aec79
--- /dev/null
+++ b/odata2-lib/odata-core/src/test/java/org/apache/olingo/odata2/core/ep/ProducerConsumerIntegrationTest.java
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+package org.apache.olingo.odata2.core.ep;
+
+import static org.junit.Assert.assertEquals;
+
+import java.io.InputStream;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.olingo.odata2.api.edm.EdmEntitySet;
+import org.apache.olingo.odata2.api.ep.EntityProvider;
+import org.apache.olingo.odata2.api.ep.EntityProviderException;
+import org.apache.olingo.odata2.api.ep.EntityProviderReadProperties;
+import org.apache.olingo.odata2.api.ep.EntityProviderWriteProperties;
+import org.apache.olingo.odata2.api.ep.entry.ODataEntry;
+import org.apache.olingo.odata2.api.processor.ODataResponse;
+import org.apache.olingo.odata2.testutil.mock.MockFacade;
+import org.junit.Test;
+
+public class ProducerConsumerIntegrationTest {
+ protected static final URI BASE_URI;
+
+ static {
+ try {
+ BASE_URI = new URI("http://host:80/service/");
+ } catch (URISyntaxException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ private static final EntityProviderReadProperties DEFAULT_READ_PROPERTIES = EntityProviderReadProperties.init()
+ .build();
+ private static final EntityProviderWriteProperties DEFAULT_WRITE_PROPERTIES = EntityProviderWriteProperties
+ .serviceRoot(
+ BASE_URI).build();
+ private static final String XML = "application/xml";
+ private static final String JSON = "application/json";
+
+ @Test
+ public void produceRoomAndThenConsumeIt() throws Exception {
+ EdmEntitySet roomSet = MockFacade.getMockEdm().getDefaultEntityContainer().getEntitySet("Rooms");
+ Map<String, Object> localRoomData = new HashMap<String, Object>();
+ localRoomData.put("Id", "1");
+ localRoomData.put("Name", "Neu \n Schwanstein蝴蝶");
+
+ Map<String, Object> properties = execute(localRoomData, roomSet, XML);
+ assertEquals("1", properties.get("Id"));
+ assertEquals("Neu \n Schwanstein蝴蝶", properties.get("Name"));
+
+ Map<String, Object> properties2 = execute(localRoomData, roomSet, JSON);
+ assertEquals("1", properties2.get("Id"));
+ assertEquals("Neu \n Schwanstein蝴蝶", properties2.get("Name"));
+ }
+
+ private Map<String, Object> execute(Map<String, Object> localRoomData, EdmEntitySet roomSet, String contentType)
+ throws EntityProviderException {
+ ODataResponse response = EntityProvider.writeEntry(contentType, roomSet, localRoomData, DEFAULT_WRITE_PROPERTIES);
+ InputStream content = (InputStream) response.getEntity();
+
+ ODataEntry entry = EntityProvider.readEntry(contentType, roomSet, content, DEFAULT_READ_PROPERTIES);
+ Map<String, Object> properties = entry.getProperties();
+ return properties;
+ }
+
+}
[07/12] [OLINGO-49],
[OLINGO-51] Support for A) Linking entities using tag within
an OData Entry B) Updating links C) Deleting links D) Code Cleanup
Posted by sk...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/352f5412/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/edm/ODataJPAEdmProviderNegativeTest.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/edm/ODataJPAEdmProviderNegativeTest.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/edm/ODataJPAEdmProviderNegativeTest.java
index 3e680f2..f4789c6 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/edm/ODataJPAEdmProviderNegativeTest.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/edm/ODataJPAEdmProviderNegativeTest.java
@@ -33,7 +33,6 @@ import org.apache.olingo.odata2.api.edm.provider.EntityContainerInfo;
import org.apache.olingo.odata2.api.edm.provider.Schema;
import org.apache.olingo.odata2.api.exception.ODataException;
import org.apache.olingo.odata2.jpa.processor.core.common.ODataJPATestConstants;
-import org.apache.olingo.odata2.jpa.processor.core.edm.ODataJPAEdmProvider;
import org.apache.olingo.odata2.jpa.processor.core.mock.ODataJPAContextMock;
import org.apache.olingo.odata2.jpa.processor.core.model.JPAEdmModel;
import org.junit.BeforeClass;
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/352f5412/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/edm/ODataJPAEdmProviderTest.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/edm/ODataJPAEdmProviderTest.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/edm/ODataJPAEdmProviderTest.java
index 44d0448..75d849b 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/edm/ODataJPAEdmProviderTest.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/edm/ODataJPAEdmProviderTest.java
@@ -38,7 +38,6 @@ import org.apache.olingo.odata2.api.edm.provider.Schema;
import org.apache.olingo.odata2.api.exception.ODataException;
import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPAModelException;
import org.apache.olingo.odata2.jpa.processor.core.common.ODataJPATestConstants;
-import org.apache.olingo.odata2.jpa.processor.core.edm.ODataJPAEdmProvider;
import org.apache.olingo.odata2.jpa.processor.core.mock.ODataJPAContextMock;
import org.apache.olingo.odata2.jpa.processor.core.mock.model.EdmSchemaMock;
import org.apache.olingo.odata2.jpa.processor.core.model.JPAEdmModel;
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/352f5412/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/jpql/JPQLBuilderFactoryTest.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/jpql/JPQLBuilderFactoryTest.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/jpql/JPQLBuilderFactoryTest.java
index a127e60..dd56f91 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/jpql/JPQLBuilderFactoryTest.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/jpql/JPQLBuilderFactoryTest.java
@@ -51,17 +51,13 @@ import org.apache.olingo.odata2.api.uri.info.GetEntityUriInfo;
import org.apache.olingo.odata2.jpa.processor.api.factory.JPAAccessFactory;
import org.apache.olingo.odata2.jpa.processor.api.factory.ODataJPAAccessFactory;
import org.apache.olingo.odata2.jpa.processor.api.jpql.JPQLContext;
-import org.apache.olingo.odata2.jpa.processor.api.jpql.JPQLContextType;
import org.apache.olingo.odata2.jpa.processor.api.jpql.JPQLContext.JPQLContextBuilder;
+import org.apache.olingo.odata2.jpa.processor.api.jpql.JPQLContextType;
import org.apache.olingo.odata2.jpa.processor.api.jpql.JPQLStatement.JPQLStatementBuilder;
import org.apache.olingo.odata2.jpa.processor.core.ODataJPAContextImpl;
import org.apache.olingo.odata2.jpa.processor.core.access.data.JPAProcessorImplTest;
import org.apache.olingo.odata2.jpa.processor.core.common.ODataJPATestConstants;
import org.apache.olingo.odata2.jpa.processor.core.factory.ODataJPAFactoryImpl;
-import org.apache.olingo.odata2.jpa.processor.core.jpql.JPQLJoinSelectSingleStatementBuilder;
-import org.apache.olingo.odata2.jpa.processor.core.jpql.JPQLJoinStatementBuilder;
-import org.apache.olingo.odata2.jpa.processor.core.jpql.JPQLSelectSingleStatementBuilder;
-import org.apache.olingo.odata2.jpa.processor.core.jpql.JPQLSelectStatementBuilder;
import org.apache.olingo.odata2.jpa.processor.core.jpql.JPQLSelectContext.JPQLSelectContextBuilder;
import org.apache.olingo.odata2.jpa.processor.core.jpql.JPQLSelectSingleContext.JPQLSelectSingleContextBuilder;
import org.easymock.EasyMock;
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/352f5412/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/jpql/JPQLJoinContextTest.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/jpql/JPQLJoinContextTest.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/jpql/JPQLJoinContextTest.java
index 33e44e2..c94160c 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/jpql/JPQLJoinContextTest.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/jpql/JPQLJoinContextTest.java
@@ -42,7 +42,6 @@ import org.apache.olingo.odata2.api.uri.info.GetEntitySetUriInfo;
import org.apache.olingo.odata2.jpa.processor.api.access.JPAJoinClause;
import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPAModelException;
import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPARuntimeException;
-import org.apache.olingo.odata2.jpa.processor.core.jpql.JPQLJoinSelectContext;
import org.apache.olingo.odata2.jpa.processor.core.jpql.JPQLJoinSelectContext.JPQLJoinContextBuilder;
import org.easymock.EasyMock;
import org.junit.After;
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/352f5412/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/jpql/JPQLJoinSelectSingleContextTest.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/jpql/JPQLJoinSelectSingleContextTest.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/jpql/JPQLJoinSelectSingleContextTest.java
index de5532c..117d21f 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/jpql/JPQLJoinSelectSingleContextTest.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/jpql/JPQLJoinSelectSingleContextTest.java
@@ -42,7 +42,6 @@ import org.apache.olingo.odata2.api.uri.info.GetEntityUriInfo;
import org.apache.olingo.odata2.jpa.processor.api.access.JPAJoinClause;
import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPAModelException;
import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPARuntimeException;
-import org.apache.olingo.odata2.jpa.processor.core.jpql.JPQLJoinSelectSingleContext;
import org.apache.olingo.odata2.jpa.processor.core.jpql.JPQLJoinSelectSingleContext.JPQLJoinSelectSingleContextBuilder;
import org.easymock.EasyMock;
import org.junit.After;
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/352f5412/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/jpql/JPQLJoinSelectSingleStatementBuilderTest.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/jpql/JPQLJoinSelectSingleStatementBuilderTest.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/jpql/JPQLJoinSelectSingleStatementBuilderTest.java
index 13f1ca5..b5412a8 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/jpql/JPQLJoinSelectSingleStatementBuilderTest.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/jpql/JPQLJoinSelectSingleStatementBuilderTest.java
@@ -35,7 +35,6 @@ import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPARuntimeExcep
import org.apache.olingo.odata2.jpa.processor.api.jpql.JPQLContextType;
import org.apache.olingo.odata2.jpa.processor.api.jpql.JPQLJoinSelectSingleContextView;
import org.apache.olingo.odata2.jpa.processor.api.jpql.JPQLStatement;
-import org.apache.olingo.odata2.jpa.processor.core.jpql.JPQLJoinSelectSingleStatementBuilder;
import org.easymock.EasyMock;
import org.junit.After;
import org.junit.AfterClass;
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/352f5412/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/jpql/JPQLJoinStatementBuilderTest.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/jpql/JPQLJoinStatementBuilderTest.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/jpql/JPQLJoinStatementBuilderTest.java
index e1637d1..2a0d4f7 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/jpql/JPQLJoinStatementBuilderTest.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/jpql/JPQLJoinStatementBuilderTest.java
@@ -31,7 +31,6 @@ import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPARuntimeExcep
import org.apache.olingo.odata2.jpa.processor.api.jpql.JPQLContextType;
import org.apache.olingo.odata2.jpa.processor.api.jpql.JPQLJoinContextView;
import org.apache.olingo.odata2.jpa.processor.api.jpql.JPQLStatement;
-import org.apache.olingo.odata2.jpa.processor.core.jpql.JPQLJoinStatementBuilder;
import org.easymock.EasyMock;
import org.junit.After;
import org.junit.AfterClass;
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/352f5412/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/jpql/JPQLSelectContextImplTest.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/jpql/JPQLSelectContextImplTest.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/jpql/JPQLSelectContextImplTest.java
index 03eb651..e793817 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/jpql/JPQLSelectContextImplTest.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/jpql/JPQLSelectContextImplTest.java
@@ -46,7 +46,6 @@ import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPARuntimeExcep
import org.apache.olingo.odata2.jpa.processor.api.jpql.JPQLContext;
import org.apache.olingo.odata2.jpa.processor.api.jpql.JPQLContextType;
import org.apache.olingo.odata2.jpa.processor.core.common.ODataJPATestConstants;
-import org.apache.olingo.odata2.jpa.processor.core.jpql.JPQLSelectContext;
import org.apache.olingo.odata2.jpa.processor.core.jpql.JPQLSelectContext.JPQLSelectContextBuilder;
import org.easymock.EasyMock;
import org.junit.BeforeClass;
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/352f5412/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/jpql/JPQLSelectSingleContextImplTest.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/jpql/JPQLSelectSingleContextImplTest.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/jpql/JPQLSelectSingleContextImplTest.java
index 69952fd..0394e54 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/jpql/JPQLSelectSingleContextImplTest.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/jpql/JPQLSelectSingleContextImplTest.java
@@ -38,7 +38,6 @@ import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPAModelExcepti
import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPARuntimeException;
import org.apache.olingo.odata2.jpa.processor.api.jpql.JPQLContext;
import org.apache.olingo.odata2.jpa.processor.api.jpql.JPQLContextType;
-import org.apache.olingo.odata2.jpa.processor.core.jpql.JPQLSelectSingleContext;
import org.apache.olingo.odata2.jpa.processor.core.jpql.JPQLSelectSingleContext.JPQLSelectSingleContextBuilder;
import org.easymock.EasyMock;
import org.junit.Test;
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/352f5412/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/jpql/JPQLSelectSingleStatementBuilderTest.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/jpql/JPQLSelectSingleStatementBuilderTest.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/jpql/JPQLSelectSingleStatementBuilderTest.java
index c65aee4..25fd5ae 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/jpql/JPQLSelectSingleStatementBuilderTest.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/jpql/JPQLSelectSingleStatementBuilderTest.java
@@ -36,10 +36,8 @@ import org.apache.olingo.odata2.api.uri.info.GetEntityUriInfo;
import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPAModelException;
import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPARuntimeException;
import org.apache.olingo.odata2.jpa.processor.api.jpql.JPQLContext;
-import org.apache.olingo.odata2.jpa.processor.api.jpql.JPQLContextType;
import org.apache.olingo.odata2.jpa.processor.api.jpql.JPQLContext.JPQLContextBuilder;
-import org.apache.olingo.odata2.jpa.processor.core.jpql.JPQLSelectSingleContext;
-import org.apache.olingo.odata2.jpa.processor.core.jpql.JPQLSelectSingleStatementBuilder;
+import org.apache.olingo.odata2.jpa.processor.api.jpql.JPQLContextType;
import org.easymock.EasyMock;
import org.junit.Before;
import org.junit.Test;
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/352f5412/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/jpql/JPQLSelectStatementBuilderTest.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/jpql/JPQLSelectStatementBuilderTest.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/jpql/JPQLSelectStatementBuilderTest.java
index 7a14f6c..617365b 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/jpql/JPQLSelectStatementBuilderTest.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/jpql/JPQLSelectStatementBuilderTest.java
@@ -37,10 +37,8 @@ import org.apache.olingo.odata2.api.uri.info.GetEntitySetUriInfo;
import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPAModelException;
import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPARuntimeException;
import org.apache.olingo.odata2.jpa.processor.api.jpql.JPQLContext;
-import org.apache.olingo.odata2.jpa.processor.api.jpql.JPQLContextType;
import org.apache.olingo.odata2.jpa.processor.api.jpql.JPQLContext.JPQLContextBuilder;
-import org.apache.olingo.odata2.jpa.processor.core.jpql.JPQLSelectContext;
-import org.apache.olingo.odata2.jpa.processor.core.jpql.JPQLSelectStatementBuilder;
+import org.apache.olingo.odata2.jpa.processor.api.jpql.JPQLContextType;
import org.easymock.EasyMock;
import org.junit.Before;
import org.junit.Test;
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/352f5412/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/ODataContextMock.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/ODataContextMock.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/ODataContextMock.java
new file mode 100644
index 0000000..d4a691e
--- /dev/null
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/ODataContextMock.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+package org.apache.olingo.odata2.jpa.processor.core.mock;
+
+import org.apache.olingo.odata2.api.ODataService;
+import org.apache.olingo.odata2.api.exception.ODataException;
+import org.apache.olingo.odata2.api.processor.ODataContext;
+import org.apache.olingo.odata2.api.uri.PathInfo;
+import org.easymock.EasyMock;
+
+public class ODataContextMock {
+
+ private ODataService odataService;
+ private PathInfo pathInfo;
+
+ public void setODataService(final ODataService service) {
+ odataService = service;
+ }
+
+ public void setPathInfo(final PathInfo pathInfo) {
+ this.pathInfo = pathInfo;
+ }
+
+ public ODataContext mock() throws ODataException {
+ ODataContext context = EasyMock.createMock(ODataContext.class);
+ EasyMock.expect(context.getService()).andReturn(odataService).anyTimes();
+ EasyMock.expect(context.getPathInfo()).andReturn(pathInfo).anyTimes();
+ EasyMock.replay(context);
+ return context;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/352f5412/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/ODataJPAContextMock.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/ODataJPAContextMock.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/ODataJPAContextMock.java
index 83ae7c0..4d00503 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/ODataJPAContextMock.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/ODataJPAContextMock.java
@@ -21,6 +21,7 @@ package org.apache.olingo.odata2.jpa.processor.core.mock;
import javax.persistence.EntityManagerFactory;
import javax.persistence.metamodel.Metamodel;
+import org.apache.olingo.odata2.api.processor.ODataContext;
import org.apache.olingo.odata2.jpa.processor.api.ODataJPAContext;
import org.easymock.EasyMock;
@@ -37,6 +38,20 @@ public abstract class ODataJPAContextMock {
EasyMock.expect(odataJPAContext.getJPAEdmMappingModel()).andReturn(MAPPING_MODEL);
EasyMock.expect(odataJPAContext.getJPAEdmExtension()).andReturn(null);
EasyMock.expect(odataJPAContext.getDefaultNaming()).andReturn(true);
+
+ EasyMock.replay(odataJPAContext);
+ return odataJPAContext;
+ }
+
+ public static ODataJPAContext mockODataJPAContext(final ODataContext context) {
+ ODataJPAContext odataJPAContext = EasyMock.createMock(ODataJPAContext.class);
+ EasyMock.expect(odataJPAContext.getPersistenceUnitName()).andStubReturn(NAMESPACE);
+ EasyMock.expect(odataJPAContext.getEntityManagerFactory()).andReturn(mockEntityManagerFactory());
+ EasyMock.expect(odataJPAContext.getJPAEdmMappingModel()).andReturn(MAPPING_MODEL);
+ EasyMock.expect(odataJPAContext.getJPAEdmExtension()).andReturn(null);
+ EasyMock.expect(odataJPAContext.getDefaultNaming()).andReturn(true);
+ EasyMock.expect(odataJPAContext.getODataContext()).andReturn(context).anyTimes();
+
EasyMock.replay(odataJPAContext);
return odataJPAContext;
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/352f5412/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/ODataServiceMock.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/ODataServiceMock.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/ODataServiceMock.java
new file mode 100644
index 0000000..c5478db
--- /dev/null
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/ODataServiceMock.java
@@ -0,0 +1,106 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+package org.apache.olingo.odata2.jpa.processor.core.mock;
+
+import java.util.List;
+
+import org.apache.olingo.odata2.api.ODataService;
+import org.apache.olingo.odata2.api.edm.Edm;
+import org.apache.olingo.odata2.api.edm.EdmAssociation;
+import org.apache.olingo.odata2.api.edm.EdmComplexType;
+import org.apache.olingo.odata2.api.edm.EdmEntityContainer;
+import org.apache.olingo.odata2.api.edm.EdmEntitySet;
+import org.apache.olingo.odata2.api.edm.EdmEntityType;
+import org.apache.olingo.odata2.api.edm.EdmException;
+import org.apache.olingo.odata2.api.edm.EdmFunctionImport;
+import org.apache.olingo.odata2.api.edm.EdmServiceMetadata;
+import org.apache.olingo.odata2.api.exception.ODataException;
+import org.apache.olingo.odata2.jpa.processor.core.mock.data.EdmMockUtilV2;
+import org.easymock.EasyMock;
+
+public class ODataServiceMock {
+
+ private Edm edmMock = null;
+ public static final String SERVICE_ROOT = "http://apache.odata.org/OData.svc/";
+
+ public ODataService mock() throws ODataException {
+ ODataService odataService = EasyMock.createMock(ODataService.class);
+ EasyMock.expect(odataService.getEntityDataModel()).andReturn(mockEdm());
+ EasyMock.replay(odataService);
+ return odataService;
+
+ }
+
+ private Edm mockEdm() {
+ if (edmMock == null) {
+ edmMock = new EdmMock();
+ }
+ return edmMock;
+ }
+
+ public static class EdmMock implements Edm {
+
+ @Override
+ public EdmEntityContainer getEntityContainer(final String name) throws EdmException {
+ return EdmMockUtilV2.mockEdmEntityContainer(name);
+ }
+
+ @Override
+ public EdmEntityType getEntityType(final String namespace, final String name) throws EdmException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public EdmComplexType getComplexType(final String namespace, final String name) throws EdmException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public EdmAssociation getAssociation(final String namespace, final String name) throws EdmException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public EdmServiceMetadata getServiceMetadata() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public EdmEntityContainer getDefaultEntityContainer() throws EdmException {
+ return EdmMockUtilV2.mockEdmEntityContainer(null);
+ }
+
+ @Override
+ public List<EdmEntitySet> getEntitySets() throws EdmException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public List<EdmFunctionImport> getFunctionImports() throws EdmException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/352f5412/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/PathInfoMock.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/PathInfoMock.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/PathInfoMock.java
new file mode 100644
index 0000000..96a920c
--- /dev/null
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/PathInfoMock.java
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+package org.apache.olingo.odata2.jpa.processor.core.mock;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.List;
+
+import org.apache.olingo.odata2.api.uri.PathInfo;
+import org.apache.olingo.odata2.api.uri.PathSegment;
+import org.easymock.EasyMock;
+
+public class PathInfoMock {
+
+ private List<PathSegment> pathSegments;
+ private URI uri;
+
+ public void setPathSegments(final List<PathSegment> pathSegments) {
+ this.pathSegments = pathSegments;
+ }
+
+ public void setServiceRootURI(final String uriString) throws URISyntaxException {
+ uri = new URI(uriString);
+ }
+
+ public PathInfo mock() {
+ PathInfo pathInfo = EasyMock.createMock(PathInfo.class);
+ EasyMock.expect(pathInfo.getODataSegments()).andReturn(pathSegments);
+ EasyMock.expect(pathInfo.getServiceRoot()).andReturn(uri);
+
+ EasyMock.replay(pathInfo);
+ return pathInfo;
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/352f5412/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/PathSegmentMock.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/PathSegmentMock.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/PathSegmentMock.java
new file mode 100644
index 0000000..77d1fbd
--- /dev/null
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/PathSegmentMock.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ ******************************************************************************/
+package org.apache.olingo.odata2.jpa.processor.core.mock;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.olingo.odata2.api.uri.PathSegment;
+
+public class PathSegmentMock implements PathSegment {
+
+ private String path;
+
+ public void setPath(final String path) {
+ this.path = path;
+ }
+
+ @Override
+ public String getPath() {
+ return path;
+ }
+
+ @Override
+ public Map<String, List<String>> getMatrixParameters() {
+ return null;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/352f5412/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/data/EdmMockUtilV2.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/data/EdmMockUtilV2.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/data/EdmMockUtilV2.java
index 2189219..2ecf5dd 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/data/EdmMockUtilV2.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/mock/data/EdmMockUtilV2.java
@@ -26,6 +26,7 @@ import java.util.UUID;
import org.apache.olingo.odata2.api.edm.EdmAssociation;
import org.apache.olingo.odata2.api.edm.EdmAssociationEnd;
import org.apache.olingo.odata2.api.edm.EdmComplexType;
+import org.apache.olingo.odata2.api.edm.EdmEntityContainer;
import org.apache.olingo.odata2.api.edm.EdmEntitySet;
import org.apache.olingo.odata2.api.edm.EdmEntityType;
import org.apache.olingo.odata2.api.edm.EdmException;
@@ -33,7 +34,7 @@ import org.apache.olingo.odata2.api.edm.EdmMapping;
import org.apache.olingo.odata2.api.edm.EdmMultiplicity;
import org.apache.olingo.odata2.api.edm.EdmNavigationProperty;
import org.apache.olingo.odata2.api.edm.EdmProperty;
-import org.apache.olingo.odata2.api.edm.EdmType;
+import org.apache.olingo.odata2.api.edm.EdmSimpleType;
import org.apache.olingo.odata2.api.edm.EdmTypeKind;
import org.apache.olingo.odata2.api.edm.provider.Mapping;
import org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmMapping;
@@ -49,6 +50,19 @@ public class EdmMockUtilV2 {
}
+ public static EdmEntityContainer mockEdmEntityContainer(final String entityName) throws EdmException {
+ EdmEntityContainer entityContainer = EasyMock.createMock(EdmEntityContainer.class);
+ entityContainer = EasyMock.createMock(EdmEntityContainer.class);
+ EasyMock.expect(entityContainer.getEntitySet(JPATypeMock.ENTITY_NAME)).andReturn(
+ mockEdmEntitySet(JPATypeMock.ENTITY_NAME, false));
+ EasyMock.expect(entityContainer.getFunctionImport(JPATypeMock.ENTITY_NAME)).andReturn(null);
+ EasyMock.expect(entityContainer.getEntitySet("JPATypeMockInvalid")).andReturn(null);
+ EasyMock.expect(entityContainer.getFunctionImport("JPATypeMockInvalid")).andReturn(null);
+ EasyMock.replay(entityContainer);
+
+ return entityContainer;
+ }
+
public static EdmEntityType mockEdmEntityType(final String entityName, final boolean withComplexType)
throws EdmException {
@@ -64,6 +78,7 @@ public class EdmMockUtilV2 {
EasyMock.expect(entityType.getNavigationPropertyNames()).andReturn(mockNavigationPropertyNames(entityName));
EasyMock.expect(entityType.getKind()).andReturn(EdmTypeKind.ENTITY);
EasyMock.expect(entityType.getMapping()).andReturn((EdmMapping) mockEdmMapping(entityName, null, null));
+ EasyMock.expect(entityType.getKeyProperties()).andReturn(mockKeyProperties(entityName)).anyTimes();
if (entityName.equals(JPATypeMock.ENTITY_NAME)) {
EasyMock.expect(entityType.getProperty(JPATypeMock.PROPERTY_NAME_MINT)).andReturn(
mockEdmProperty(entityName, JPATypeMock.PROPERTY_NAME_MINT)).anyTimes();
@@ -89,6 +104,13 @@ public class EdmMockUtilV2 {
return entityType;
}
+ public static List<EdmProperty> mockKeyProperties(final String entityName) throws EdmException {
+ List<EdmProperty> edmProperties = new ArrayList<EdmProperty>();
+ edmProperties.add(mockEdmProperty(entityName, JPATypeMock.PROPERTY_NAME_MINT));
+
+ return edmProperties;
+ }
+
public static List<String> mockNavigationPropertyNames(final String entityName) {
List<String> propertyNames = new ArrayList<String>();
propertyNames.add(JPATypeMock.NAVIGATION_PROPERTY_X);
@@ -211,9 +233,10 @@ public class EdmMockUtilV2 {
propertyName.equals(JPARelatedTypeMock.PROPERTY_NAME_MDOUBLE) ||
propertyName.equals(JPARelatedTypeMock.PROPERTY_NAME_MBYTEARRAY)) {
- EdmType edmType = EasyMock.createMock(EdmType.class);
+ EdmSimpleType edmType = EasyMock.createMock(EdmSimpleType.class);
EasyMock.expect(edmProperty.getType()).andReturn(edmType).anyTimes();
EasyMock.expect(edmType.getKind()).andReturn(EdmTypeKind.SIMPLE).anyTimes();
+ EasyMock.expect(edmType.isCompatible(EasyMock.isA(EdmSimpleType.class))).andReturn(true).anyTimes();
EasyMock.replay(edmType);
EasyMock.expect(edmProperty.getName()).andReturn(propertyName).anyTimes();
EasyMock.expect(edmProperty.getMapping()).andReturn((EdmMapping) mockEdmMapping(entityName, propertyName, null))
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/352f5412/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmAssociationEndTest.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmAssociationEndTest.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmAssociationEndTest.java
index b756f91..a066972 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmAssociationEndTest.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmAssociationEndTest.java
@@ -37,7 +37,6 @@ import org.apache.olingo.odata2.jpa.processor.core.common.ODataJPATestConstants;
import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPAAttributeMock;
import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPAEdmMockData.SimpleType;
import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPAEdmMockData.SimpleType.SimpleTypeA;
-import org.apache.olingo.odata2.jpa.processor.core.model.JPAEdmAssociationEnd;
import org.junit.BeforeClass;
import org.junit.Test;
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/352f5412/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmAssociationSetTest.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmAssociationSetTest.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmAssociationSetTest.java
index cb7d252..2cf50ca 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmAssociationSetTest.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmAssociationSetTest.java
@@ -40,7 +40,6 @@ import org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmAssociationView;
import org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmEntityContainerView;
import org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmEntitySetView;
import org.apache.olingo.odata2.jpa.processor.core.common.ODataJPATestConstants;
-import org.apache.olingo.odata2.jpa.processor.core.model.JPAEdmAssociationSet;
import org.junit.Before;
import org.junit.Test;
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/352f5412/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmAssociationTest.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmAssociationTest.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmAssociationTest.java
index 3923dd8..8c3b119 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmAssociationTest.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmAssociationTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
-
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -48,9 +48,6 @@ import org.apache.olingo.odata2.jpa.processor.core.common.ODataJPATestConstants;
import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPAAttributeMock;
import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPAEdmMockData.SimpleType;
import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPAEdmMockData.SimpleType.SimpleTypeA;
-import org.apache.olingo.odata2.jpa.processor.core.model.JPAEdmAssociation;
-import org.apache.olingo.odata2.jpa.processor.core.model.JPAEdmAssociationEnd;
-import org.apache.olingo.odata2.jpa.processor.core.model.JPAEdmReferentialConstraint;
import org.easymock.EasyMock;
import org.junit.BeforeClass;
import org.junit.Test;
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/352f5412/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmBaseViewImplTest.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmBaseViewImplTest.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmBaseViewImplTest.java
index 237a6a3..4f4a479 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmBaseViewImplTest.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmBaseViewImplTest.java
@@ -26,7 +26,6 @@ import javax.persistence.metamodel.Metamodel;
import org.apache.olingo.odata2.jpa.processor.api.access.JPAEdmBuilder;
import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPAMetaModelMock;
-import org.apache.olingo.odata2.jpa.processor.core.model.JPAEdmBaseViewImpl;
import org.junit.Before;
import org.junit.Test;
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/352f5412/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmComplexTypeTest.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmComplexTypeTest.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmComplexTypeTest.java
index 9ab7872..ae1c5f1 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmComplexTypeTest.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmComplexTypeTest.java
@@ -46,8 +46,6 @@ import org.apache.olingo.odata2.jpa.processor.core.common.ODataJPATestConstants;
import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPAEmbeddableMock;
import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPAMetaModelMock;
import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPASingularAttributeMock;
-import org.apache.olingo.odata2.jpa.processor.core.model.JPAEdmComplexType;
-import org.apache.olingo.odata2.jpa.processor.core.model.JPAEdmMappingImpl;
import org.junit.BeforeClass;
import org.junit.Test;
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/352f5412/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmEntityContainerTest.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmEntityContainerTest.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmEntityContainerTest.java
index 0d6a2c1..f94fa6f 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmEntityContainerTest.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmEntityContainerTest.java
@@ -43,7 +43,6 @@ import org.apache.olingo.odata2.jpa.processor.core.common.ODataJPATestConstants;
import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPAEntityTypeMock;
import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPAMetaModelMock;
import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPASingularAttributeMock;
-import org.apache.olingo.odata2.jpa.processor.core.model.JPAEdmEntityContainer;
import org.junit.Before;
import org.junit.Test;
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/352f5412/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmEntitySetTest.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmEntitySetTest.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmEntitySetTest.java
index f8f5321..6994dd9 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmEntitySetTest.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmEntitySetTest.java
@@ -43,7 +43,6 @@ import org.apache.olingo.odata2.jpa.processor.core.common.ODataJPATestConstants;
import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPAEntityTypeMock;
import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPAMetaModelMock;
import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPASingularAttributeMock;
-import org.apache.olingo.odata2.jpa.processor.core.model.JPAEdmEntitySet;
import org.junit.Before;
import org.junit.Test;
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/352f5412/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmEntityTypeTest.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmEntityTypeTest.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmEntityTypeTest.java
index ad1a5c0..8c79ece 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmEntityTypeTest.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmEntityTypeTest.java
@@ -40,7 +40,6 @@ import org.apache.olingo.odata2.jpa.processor.core.common.ODataJPATestConstants;
import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPAEntityTypeMock;
import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPAMetaModelMock;
import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPASingularAttributeMock;
-import org.apache.olingo.odata2.jpa.processor.core.model.JPAEdmEntityType;
import org.junit.Before;
import org.junit.Test;
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/352f5412/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmFunctionImportTest.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmFunctionImportTest.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmFunctionImportTest.java
index 5992418..db23397 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmFunctionImportTest.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmFunctionImportTest.java
@@ -47,7 +47,6 @@ import org.apache.olingo.odata2.jpa.processor.core.common.ODataJPATestConstants;
import org.apache.olingo.odata2.jpa.processor.core.mock.ODataJPAContextMock;
import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPACustomProcessorMock;
import org.apache.olingo.odata2.jpa.processor.core.mock.model._JPACustomProcessorNegativeMock;
-import org.apache.olingo.odata2.jpa.processor.core.model.JPAEdmFunctionImport;
import org.junit.Before;
import org.junit.Test;
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/352f5412/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmKeyTest.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmKeyTest.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmKeyTest.java
index 533e4e8..459a2c4 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmKeyTest.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmKeyTest.java
@@ -42,7 +42,6 @@ import org.apache.olingo.odata2.jpa.processor.core.mock.ODataJPAContextMock;
import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPAAttributeMock;
import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPAEdmMockData;
import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPAEdmMockData.ComplexType.ComplexTypeA;
-import org.apache.olingo.odata2.jpa.processor.core.model.JPAEdmKey;
import org.junit.BeforeClass;
import org.junit.Test;
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/352f5412/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmModelTest.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmModelTest.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmModelTest.java
index 354f910..120b209 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmModelTest.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmModelTest.java
@@ -34,7 +34,6 @@ import org.apache.olingo.odata2.jpa.processor.core.common.ODataJPATestConstants;
import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPAEmbeddableMock;
import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPAMetaModelMock;
import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPASingularAttributeMock;
-import org.apache.olingo.odata2.jpa.processor.core.model.JPAEdmModel;
import org.junit.Before;
import org.junit.Test;
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/352f5412/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmNavigationPropertyTest.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmNavigationPropertyTest.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmNavigationPropertyTest.java
index 8c7aea6..354fecc 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmNavigationPropertyTest.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmNavigationPropertyTest.java
@@ -37,7 +37,6 @@ import org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmEntityTypeView;
import org.apache.olingo.odata2.jpa.processor.core.common.ODataJPATestConstants;
import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPAEntityTypeMock;
import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPAPluralAttributeMock;
-import org.apache.olingo.odata2.jpa.processor.core.model.JPAEdmNavigationProperty;
import org.junit.BeforeClass;
import org.junit.Test;
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/352f5412/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmPropertyTest.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmPropertyTest.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmPropertyTest.java
index 877d883..c204d1f 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmPropertyTest.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmPropertyTest.java
@@ -47,14 +47,13 @@ import org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmEntityContainerVie
import org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmEntitySetView;
import org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmEntityTypeView;
import org.apache.olingo.odata2.jpa.processor.core.common.ODataJPATestConstants;
+import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPAEdmMockData.ComplexType;
+import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPAEdmMockData.SimpleType;
import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPAEmbeddableTypeMock;
import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPAEntityTypeMock;
import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPAMetaModelMock;
import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPAPluralAttributeMock;
import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPASingularAttributeMock;
-import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPAEdmMockData.ComplexType;
-import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPAEdmMockData.SimpleType;
-import org.apache.olingo.odata2.jpa.processor.core.model.JPAEdmProperty;
import org.junit.Test;
public class JPAEdmPropertyTest extends JPAEdmTestModelView {
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/352f5412/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmReferentialConstraintRoleTest.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmReferentialConstraintRoleTest.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmReferentialConstraintRoleTest.java
index a453984..5737c41 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmReferentialConstraintRoleTest.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmReferentialConstraintRoleTest.java
@@ -47,8 +47,6 @@ import org.apache.olingo.odata2.jpa.processor.core.common.ODataJPATestConstants;
import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPAAttributeMock;
import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPAJavaMemberMock;
import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPAManagedTypeMock;
-import org.apache.olingo.odata2.jpa.processor.core.model.JPAEdmMappingImpl;
-import org.apache.olingo.odata2.jpa.processor.core.model.JPAEdmReferentialConstraintRole;
import org.easymock.EasyMock;
import org.junit.Before;
import org.junit.Test;
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/352f5412/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmReferentialConstraintTest.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmReferentialConstraintTest.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmReferentialConstraintTest.java
index 885ff86..6e7f6b3 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmReferentialConstraintTest.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmReferentialConstraintTest.java
@@ -40,7 +40,6 @@ import org.apache.olingo.odata2.jpa.processor.core.common.ODataJPATestConstants;
import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPAAttributeMock;
import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPAJavaMemberMock;
import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPAManagedTypeMock;
-import org.apache.olingo.odata2.jpa.processor.core.model.JPAEdmReferentialConstraint;
import org.easymock.EasyMock;
import org.junit.Before;
import org.junit.Test;
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/352f5412/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmSchemaTest.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmSchemaTest.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmSchemaTest.java
index b366191..8408c9f 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmSchemaTest.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmSchemaTest.java
@@ -28,7 +28,6 @@ import javax.persistence.metamodel.Metamodel;
import org.apache.olingo.odata2.jpa.processor.api.access.JPAEdmBuilder;
import org.apache.olingo.odata2.jpa.processor.core.mock.model.JPAMetaModelMock;
-import org.apache.olingo.odata2.jpa.processor.core.model.JPAEdmSchema;
import org.junit.Before;
import org.junit.Test;
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/352f5412/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmTestModelView.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmTestModelView.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmTestModelView.java
index d145239..7a6f90f 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmTestModelView.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/JPAEdmTestModelView.java
@@ -386,15 +386,21 @@ public class JPAEdmTestModelView implements JPAEdmAssociationEndView, JPAEdmAsso
}
@Override
- public boolean isReferencedInKey(String complexTypeName) {
+ public boolean isReferencedInKey(final String complexTypeName) {
// TODO Auto-generated method stub
return false;
}
@Override
- public void setReferencedInKey(String complexTypeName) {
+ public void setReferencedInKey(final String complexTypeName) {
// TODO Auto-generated method stub
}
+ @Override
+ public Attribute<?, ?> getJPAReferencedAttribute() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/352f5412/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/_JPAEdmFunctionImportTest.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/_JPAEdmFunctionImportTest.java b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/_JPAEdmFunctionImportTest.java
index 02b6c9f..e8f3e7b 100644
--- a/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/_JPAEdmFunctionImportTest.java
+++ b/odata2-jpa-processor/jpa-core/src/test/java/org/apache/olingo/odata2/jpa/processor/core/model/_JPAEdmFunctionImportTest.java
@@ -48,7 +48,6 @@ import org.apache.olingo.odata2.jpa.processor.core.common.ODataJPATestConstants;
import org.apache.olingo.odata2.jpa.processor.core.mock.ODataJPAContextMock;
import org.apache.olingo.odata2.jpa.processor.core.mock.model._JPACustomProcessorMock;
import org.apache.olingo.odata2.jpa.processor.core.mock.model._JPACustomProcessorNegativeMock;
-import org.apache.olingo.odata2.jpa.processor.core.model.JPAEdmFunctionImport;
import org.junit.Before;
import org.junit.Test;
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/352f5412/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Address.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Address.java b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Address.java
index ab21848..0ae4adf 100644
--- a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Address.java
+++ b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Address.java
@@ -48,7 +48,7 @@ public class Address {
@Column(name = "COUNTRY")
private String country;
-
+
@Column(name = "PINCODE")
private String pincode;
@@ -56,7 +56,7 @@ public class Address {
return pincode;
}
- public void setPincode(String pincode) {
+ public void setPincode(final String pincode) {
this.pincode = pincode;
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/352f5412/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Category.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Category.java b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Category.java
index 34891a7..22e2966 100644
--- a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Category.java
+++ b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Category.java
@@ -32,10 +32,10 @@ import javax.persistence.Table;
public class Category {
@Id
- @Column(name="CODE")
+ @Column(name = "CODE")
private char code[] = new char[2];
- @Column(name="DESC")
+ @Column(name = "DESC")
private String description;
@OneToMany(mappedBy = "category")
@@ -45,7 +45,7 @@ public class Category {
return materials;
}
- public void setMaterials(List<Material> materials) {
+ public void setMaterials(final List<Material> materials) {
this.materials = materials;
}
@@ -53,7 +53,7 @@ public class Category {
return code;
}
- public void setCode(char[] code) {
+ public void setCode(final char[] code) {
this.code = code;
}
@@ -61,7 +61,7 @@ public class Category {
return description;
}
- public void setDescription(String description) {
+ public void setDescription(final String description) {
this.description = description;
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/352f5412/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Customer.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Customer.java b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Customer.java
index c28e37e..18f24b4 100644
--- a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Customer.java
+++ b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Customer.java
@@ -49,7 +49,7 @@ public class Customer {
return id;
}
- public void setId(Long id) {
+ public void setId(final Long id) {
this.id = id;
}
@@ -57,7 +57,7 @@ public class Customer {
return name;
}
- public void setName(String name) {
+ public void setName(final String name) {
this.name = name;
}
@@ -65,7 +65,7 @@ public class Customer {
return orders;
}
- public void setOrders(List<SalesOrderHeader> orders) {
+ public void setOrders(final List<SalesOrderHeader> orders) {
this.orders = orders;
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/352f5412/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Material.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Material.java b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Material.java
index 7330042..c4ca423 100644
--- a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Material.java
+++ b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/Material.java
@@ -40,7 +40,6 @@ public class Material {
final String measurementUnit) {
super();
this.materialName = materialName;
- this.typeCode = typeCode;
this.price = price;
this.measurementUnit = measurementUnit;
}
@@ -52,9 +51,6 @@ public class Material {
@Column(name = "MATERIAL_NAME")
private String materialName;
- @Column(name = "TYPE_CODE")
- private char[] typeCode = new char[2];
-
@Column(name = "PRICE")
private double price;
@@ -80,7 +76,7 @@ public class Material {
return category;
}
- public void setCategory(Category category) {
+ public void setCategory(final Category category) {
this.category = category;
}
@@ -92,14 +88,6 @@ public class Material {
this.materialName = materialName;
}
- public char[] getTypeCode() {
- return typeCode;
- }
-
- public void setTypeCode(final char[] typeCode) {
- this.typeCode = typeCode;
- }
-
public double getPrice() {
return price;
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/352f5412/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/SalesOrderHeader.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/SalesOrderHeader.java b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/SalesOrderHeader.java
index 3ed1ee5..c6a28c5 100644
--- a/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/SalesOrderHeader.java
+++ b/odata2-jpa-processor/jpa-ref/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/model/SalesOrderHeader.java
@@ -98,7 +98,7 @@ public class SalesOrderHeader {
return customerId;
}
- public void setCustomerId(Long customerId) {
+ public void setCustomerId(final Long customerId) {
this.customerId = customerId;
}
@@ -106,7 +106,7 @@ public class SalesOrderHeader {
return customer;
}
- public void setCustomer(Customer customer) {
+ public void setCustomer(final Customer customer) {
this.customer = customer;
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/352f5412/odata2-jpa-processor/jpa-ref/src/main/resources/META-INF/persistence.xml
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-ref/src/main/resources/META-INF/persistence.xml b/odata2-jpa-processor/jpa-ref/src/main/resources/META-INF/persistence.xml
index b5ff286..29e5007 100644
--- a/odata2-jpa-processor/jpa-ref/src/main/resources/META-INF/persistence.xml
+++ b/odata2-jpa-processor/jpa-ref/src/main/resources/META-INF/persistence.xml
@@ -18,10 +18,10 @@
<class>org.apache.olingo.odata2.jpa.processor.ref.model.SalesOrderHeader</class>
<class>org.apache.olingo.odata2.jpa.processor.ref.model.SalesOrderItem</class>
<class>org.apache.olingo.odata2.jpa.processor.ref.model.Note</class>
- <class>org.apache.olingo.odata2.jpa.processor.ref.model.Material</class>
<class>org.apache.olingo.odata2.jpa.processor.ref.model.Store</class>
- <class>org.apache.olingo.odata2.jpa.processor.ref.model.Category</class>
<class>org.apache.olingo.odata2.jpa.processor.ref.model.Customer</class>
+ <class>org.apache.olingo.odata2.jpa.processor.ref.model.Category</class>
+ <class>org.apache.olingo.odata2.jpa.processor.ref.model.Material</class>
<properties>
<property name="javax.persistence.jdbc.driver" value="org.hsqldb.jdbcDriver" />
<property name="javax.persistence.jdbc.url"
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/352f5412/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/extension/OrderValue.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/extension/OrderValue.java b/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/extension/OrderValue.java
index 9dde58f..7b056e0 100644
--- a/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/extension/OrderValue.java
+++ b/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/extension/OrderValue.java
@@ -27,7 +27,7 @@ public class OrderValue {
return amount;
}
- public void setAmount(double amount) {
+ public void setAmount(final double amount) {
this.amount = amount;
}
@@ -35,7 +35,7 @@ public class OrderValue {
return currency;
}
- public void setCurrency(String currency) {
+ public void setCurrency(final String currency) {
this.currency = currency;
}
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/352f5412/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/extension/SalesOrderProcessingExtension.java
----------------------------------------------------------------------
diff --git a/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/extension/SalesOrderProcessingExtension.java b/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/extension/SalesOrderProcessingExtension.java
index 94aad4f..3133944 100644
--- a/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/extension/SalesOrderProcessingExtension.java
+++ b/odata2-jpa-processor/jpa-web/src/main/java/org/apache/olingo/odata2/jpa/processor/ref/extension/SalesOrderProcessingExtension.java
@@ -39,24 +39,24 @@ public class SalesOrderProcessingExtension implements JPAEdmExtension {
private ComplexType getComplexType() {
ComplexType complexType = new ComplexType();
-
+
List<Property> properties = new ArrayList<Property>();
SimpleProperty property = new SimpleProperty();
-
+
property.setName("Amount");
property.setType(EdmSimpleTypeKind.Double);
properties.add(property);
-
+
property = new SimpleProperty();
property.setName("Currency");
property.setType(EdmSimpleTypeKind.String);
properties.add(property);
-
+
complexType.setName("OrderValue");
complexType.setProperties(properties);
-
+
return complexType;
-
+
}
@Override
[03/12] git commit: [OLINGO-113] Fixed too long line (checkstyle)
Posted by sk...@apache.org.
[OLINGO-113] Fixed too long line (checkstyle)
Project: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/commit/d98180e6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/tree/d98180e6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/diff/d98180e6
Branch: refs/heads/olingo-117
Commit: d98180e6e0e77fde212d6e84ecf3450db4c55dcb
Parents: 42290ba
Author: Michael Bolz <mi...@apache.org>
Authored: Thu Jan 9 13:59:00 2014 +0100
Committer: Stephan Klevenz <sk...@apache.org>
Committed: Tue Jan 14 12:24:42 2014 +0100
----------------------------------------------------------------------
.../processor/core/datasource/AnnotationInMemoryDs.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-olingo-odata2/blob/d98180e6/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/datasource/AnnotationInMemoryDs.java
----------------------------------------------------------------------
diff --git a/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/datasource/AnnotationInMemoryDs.java b/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/datasource/AnnotationInMemoryDs.java
index 2f8fa10..db5b79b 100644
--- a/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/datasource/AnnotationInMemoryDs.java
+++ b/odata2-annotation-processor/annotation-processor-core/src/main/java/org/apache/olingo/odata2/annotation/processor/core/datasource/AnnotationInMemoryDs.java
@@ -50,7 +50,8 @@ public class AnnotationInMemoryDs implements DataSource {
this(annotatedClasses, true);
}
- public AnnotationInMemoryDs(final Collection<Class<?>> annotatedClasses, final boolean persistInMemory) throws ODataException {
+ public AnnotationInMemoryDs(final Collection<Class<?>> annotatedClasses, final boolean persistInMemory)
+ throws ODataException {
this.persistInMemory = persistInMemory;
init(annotatedClasses);
}