summaryrefslogtreecommitdiff
path: root/examples/sql/adf/EX_ADF/Model/src
diff options
context:
space:
mode:
Diffstat (limited to 'examples/sql/adf/EX_ADF/Model/src')
-rw-r--r--examples/sql/adf/EX_ADF/Model/src/dbschema/ForeignKeysCoffees.java90
-rw-r--r--examples/sql/adf/EX_ADF/Model/src/dbschema/PrimaryKeysSuppliers.java74
-rw-r--r--examples/sql/adf/EX_ADF/Model/src/model/Model.jpx51
-rw-r--r--examples/sql/adf/EX_ADF/Model/src/model/ModelBundle.properties6
-rw-r--r--examples/sql/adf/EX_ADF/Model/src/model/entity/CoffeesEO.xml84
-rw-r--r--examples/sql/adf/EX_ADF/Model/src/model/entity/CoffeesEOImpl.java281
-rw-r--r--examples/sql/adf/EX_ADF/Model/src/model/entity/SuppliersEO.xml79
-rw-r--r--examples/sql/adf/EX_ADF/Model/src/model/entity/SuppliersEOImpl.java302
-rw-r--r--examples/sql/adf/EX_ADF/Model/src/model/entity/association/SuppliersEOToCoffeesEOAssoc.xml45
-rw-r--r--examples/sql/adf/EX_ADF/Model/src/uimodel/am/AppModule.xml34
-rw-r--r--examples/sql/adf/EX_ADF/Model/src/uimodel/am/TestClient.java179
-rw-r--r--examples/sql/adf/EX_ADF/Model/src/uimodel/am/common/bc4j.xcfg15
-rw-r--r--examples/sql/adf/EX_ADF/Model/src/uimodel/view/CoffeesVO.xml94
-rw-r--r--examples/sql/adf/EX_ADF/Model/src/uimodel/view/SuppliersVO.xml74
-rw-r--r--examples/sql/adf/EX_ADF/Model/src/uimodel/view/SuppliersVOToCoffeesVOLink.xml44
15 files changed, 1452 insertions, 0 deletions
diff --git a/examples/sql/adf/EX_ADF/Model/src/dbschema/ForeignKeysCoffees.java b/examples/sql/adf/EX_ADF/Model/src/dbschema/ForeignKeysCoffees.java
new file mode 100644
index 00000000..92508208
--- /dev/null
+++ b/examples/sql/adf/EX_ADF/Model/src/dbschema/ForeignKeysCoffees.java
@@ -0,0 +1,90 @@
+/*-
+ * See the file LICENSE for redistribution information.
+ *
+ * Copyright (c) 2013, 2015 Oracle and/or its affiliates. All rights reserved.
+ *
+ */
+
+import java.sql.*;
+
+public class ForeignKeysCoffees {
+
+ public static void main(String args[]) {
+
+ String url = "jdbc:sqlite:/path_to_db";
+ Connection con;
+ String createString = "create table COFFEESFK " +
+ "(COF_NAME varchar(32) NOT NULL, " + "SUP_ID int, " +
+ "PRICE float, " + "SALES int, " + "TOTAL int, " +
+ "primary key(COF_NAME), " +
+ "foreign key(SUP_ID) references SUPPLIERSPK(SUP_ID))";
+ Statement stmt;
+
+ try {
+ Class.forName("SQLite.JDBCDriver");
+ } catch(java.lang.ClassNotFoundException e) {
+ System.err.print("ClassNotFoundException: ");
+ System.err.println(e.getMessage());
+ }
+
+ try {
+ con = DriverManager.getConnection(url,
+ "myLogin", "myPassword");
+
+ stmt = con.createStatement();
+ stmt.execute("PRAGMA foreign_keys = ON;");
+ stmt.executeUpdate("drop table if exists COFFEESFK");
+ stmt.executeUpdate(createString);
+
+ DatabaseMetaData dbmd = con.getMetaData();
+ ResultSet rs = dbmd.getImportedKeys(null, null, "COFFEESFK");
+ while (rs.next()) {
+ System.out.println("primary key table name: " +
+ rs.getString("PKTABLE_NAME"));
+ System.out.println("primary key column name: " +
+ rs.getString("PKCOLUMN_NAME"));
+ System.out.println("foreign key table name: " +
+ rs.getString("FKTABLE_NAME"));
+ System.out.println("foreign key column name: " +
+ rs.getString("FKCOLUMN_NAME"));
+ }
+
+ stmt.executeUpdate("insert into COFFEESFK " +
+ "values('Colombian', 00101, 7.99, 0, 0)");
+
+ stmt.executeUpdate("insert into COFFEESFK " +
+ "values('French_Roast', 00049, 8.99, 0, 0)");
+
+ stmt.executeUpdate("insert into COFFEESFK " +
+ "values('Espresso', 00150, 9.99, 0, 0)");
+
+ stmt.executeUpdate("insert into COFFEESFK " +
+ "values('Colombian_Decaf', 00101, 8.99, 0, 0)");
+
+ stmt.executeUpdate("insert into COFFEESFK " +
+ "values('French_Roast_Decaf', 00150, 9.99, 0, 0)");
+
+ rs = stmt.executeQuery("select * from COFFEESFK");
+
+ System.out.println("select * from COFFEESFK:");
+ while (rs.next()) {
+ String name = rs.getString("COF_NAME");
+ int id = rs.getInt("SUP_ID");
+ float price = rs.getFloat("PRICE");
+ int sales = rs.getInt("Sales");
+ int total = rs.getInt("Total");
+ System.out.println(name + ", " + id + ", " +
+ price + ", " + sales + ", " + total);
+ }
+
+ rs.close();
+ stmt.close();
+ con.close();
+
+ } catch(SQLException ex) {
+ System.err.print("SQLException: ");
+ System.err.println(ex.getMessage());
+ }
+ }
+}
+
diff --git a/examples/sql/adf/EX_ADF/Model/src/dbschema/PrimaryKeysSuppliers.java b/examples/sql/adf/EX_ADF/Model/src/dbschema/PrimaryKeysSuppliers.java
new file mode 100644
index 00000000..069299c3
--- /dev/null
+++ b/examples/sql/adf/EX_ADF/Model/src/dbschema/PrimaryKeysSuppliers.java
@@ -0,0 +1,74 @@
+/*-
+ * See the file LICENSE for redistribution information.
+ *
+ * Copyright (c) 2013, 2015 Oracle and/or its affiliates. All rights reserved.
+ *
+ */
+
+import java.sql.*;
+
+public class PrimaryKeysSuppliers {
+
+ public static void main(String args[]) {
+
+ String url = "jdbc:sqlite:/path_to_db";
+ Connection con;
+ String createString = "create table SUPPLIERSPK " +
+ "(SUP_ID INTEGER NOT NULL, " + "SUP_NAME VARCHAR(40), " +
+ "STREET VARCHAR(40), " + "CITY VARCHAR(20), " +
+ "STATE CHAR(2), " + "ZIP CHAR(5), " +
+ "primary key(SUP_ID))";
+ Statement stmt;
+
+ try {
+ Class.forName("SQLite.JDBCDriver");
+ } catch(java.lang.ClassNotFoundException e) {
+ System.err.print("ClassNotFoundException: ");
+ System.err.println(e.getMessage());
+ }
+
+ try {
+ con = DriverManager.getConnection(url,
+ "myLogin", "myPassword");
+
+ stmt = con.createStatement();
+ stmt.executeUpdate("drop table if exists SUPPLIERSPK");
+ stmt.executeUpdate(createString);
+
+ stmt.executeUpdate("insert into SUPPLIERSPK " +
+ "values(49, 'Superior Coffee', '1 Party Place', " +
+ "'Mendocino', 'CA', '95460')");
+
+ stmt.executeUpdate("insert into SUPPLIERSPK " +
+ "values(101, 'Acme, Inc.', '99 Market Street', " +
+ "'Groundsville', 'CA', '95199')");
+
+ stmt.executeUpdate("insert into SUPPLIERSPK " +
+ "values(150, 'The High Ground', '100 Coffee Lane', " +
+ "'Meadows', 'CA', '93966')");
+
+ ResultSet rs = stmt.executeQuery("select * from SUPPLIERSPK");
+
+ System.out.println("select * from SUPPLIERSPK:");
+ while (rs.next()) {
+ int id = rs.getInt("SUP_ID");
+ String name = rs.getString("SUP_NAME");
+ String street = rs.getString("STREET");
+ String city = rs.getString("CITY");
+ String state = rs.getString("STATE");
+ String zip = rs.getString("ZIP");
+ System.out.println(id + ", " + name + ", " +
+ street + ", " + city + ", " + state + ", " + zip);
+ }
+
+ rs.close();
+ stmt.close();
+ con.close();
+
+ } catch(SQLException ex) {
+ System.err.print("SQLException: ");
+ System.err.println(ex.getMessage());
+ }
+ }
+}
+
diff --git a/examples/sql/adf/EX_ADF/Model/src/model/Model.jpx b/examples/sql/adf/EX_ADF/Model/src/model/Model.jpx
new file mode 100644
index 00000000..9b0ab3d3
--- /dev/null
+++ b/examples/sql/adf/EX_ADF/Model/src/model/Model.jpx
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="GBK" ?>
+<!DOCTYPE JboProject SYSTEM "jbo_03_01.dtd">
+<!---->
+<JboProject
+ xmlns="http://xmlns.oracle.com/bc4j"
+ Name="Model"
+ Version="11.1.2.64.36"
+ SeparateXMLFiles="true"
+ PackageName="model">
+ <DesignTime>
+ <Attr Name="_useAnsiJoinSyntax" Value="true"/>
+ <Attr Name="_jprName" Value="../../Model.jpr"/>
+ <Attr Name="_jbo.SQLBuilder" Value="SQL92"/>
+ <Attr Name="_jbo.TypeMapEntries" Value="Java"/>
+ <Attr Name="_NamedConnection" Value="BDBConnection"/>
+ <Attr Name="_appModuleNames0" Value="uimodel.am.AppModule"/>
+ </DesignTime>
+ <Containee
+ Name="association"
+ PackageName="model.entity.association"
+ ObjectType="JboPackage">
+ <DesignTime>
+ <Attr Name="_AS" Value="true"/>
+ </DesignTime>
+ </Containee>
+ <Containee
+ Name="entity"
+ PackageName="model.entity"
+ ObjectType="JboPackage">
+ <DesignTime>
+ <Attr Name="_EO" Value="true"/>
+ </DesignTime>
+ </Containee>
+ <Containee
+ Name="am"
+ PackageName="uimodel.am"
+ ObjectType="JboPackage">
+ <DesignTime>
+ <Attr Name="_AM" Value="true"/>
+ </DesignTime>
+ </Containee>
+ <Containee
+ Name="view"
+ PackageName="uimodel.view"
+ ObjectType="JboPackage">
+ <DesignTime>
+ <Attr Name="_VO" Value="true"/>
+ <Attr Name="_VL" Value="true"/>
+ </DesignTime>
+ </Containee>
+</JboProject>
diff --git a/examples/sql/adf/EX_ADF/Model/src/model/ModelBundle.properties b/examples/sql/adf/EX_ADF/Model/src/model/ModelBundle.properties
new file mode 100644
index 00000000..a5910d8c
--- /dev/null
+++ b/examples/sql/adf/EX_ADF/Model/src/model/ModelBundle.properties
@@ -0,0 +1,6 @@
+#
+uimodel.view.CoffeesVO_LABEL=Coffees Vo
+uimodel.am.AppModule_LABEL=App Module Client
+uimodel.view.SuppliersVO_LABEL=Suppliers Vo
+uimodel.view.SuppliersVOToCoffeesVOLink_LABEL=Suppliers Vo To Coffees Vo Link
+LOV_SupId_LOVUIHints_NullValueId=<No Selection>
diff --git a/examples/sql/adf/EX_ADF/Model/src/model/entity/CoffeesEO.xml b/examples/sql/adf/EX_ADF/Model/src/model/entity/CoffeesEO.xml
new file mode 100644
index 00000000..fef443b4
--- /dev/null
+++ b/examples/sql/adf/EX_ADF/Model/src/model/entity/CoffeesEO.xml
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="GBK" ?>
+<!DOCTYPE Entity SYSTEM "jbo_03_01.dtd">
+<!---->
+<Entity
+ xmlns="http://xmlns.oracle.com/bc4j"
+ Name="CoffeesEO"
+ Version="11.1.2.64.36"
+ DBObjectType="TABLE"
+ DBObjectName="COFFEESFK"
+ AliasName="CoffeesEO"
+ BindingStyle="JDBC"
+ UseGlueCode="false"
+ RowClass="model.entity.CoffeesEOImpl">
+ <DesignTime>
+ <Attr Name="_codeGenFlag2" Value="Access"/>
+ <Attr Name="_isCodegen" Value="true"/>
+ </DesignTime>
+ <Attribute
+ Name="CofName"
+ IsNotNull="true"
+ ColumnName="COF_NAME"
+ SQLType="VARCHAR"
+ Type="java.lang.String"
+ ColumnType="VARCHAR"
+ TableName="COFFEESFK"
+ PrimaryKey="true"/>
+ <Attribute
+ Name="SupId"
+ ColumnName="SUP_ID"
+ SQLType="INTEGER"
+ Type="java.lang.Integer"
+ ColumnType="INTEGER"
+ TableName="COFFEESFK"/>
+ <Attribute
+ Name="Price"
+ ColumnName="PRICE"
+ SQLType="FLOAT"
+ Type="java.lang.Float"
+ ColumnType="FLOAT"
+ TableName="COFFEESFK"/>
+ <Attribute
+ Name="Sales"
+ ColumnName="SALES"
+ SQLType="INTEGER"
+ Type="java.lang.Integer"
+ ColumnType="INTEGER"
+ TableName="COFFEESFK"/>
+ <Attribute
+ Name="Total"
+ ColumnName="TOTAL"
+ SQLType="INTEGER"
+ Type="java.lang.Integer"
+ ColumnType="INTEGER"
+ TableName="COFFEESFK"/>
+ <AccessorAttribute
+ Name="SuppliersEO"
+ Association="model.entity.association.SuppliersEOToCoffeesEOAssoc"
+ AssociationEnd="model.entity.association.SuppliersEOToCoffeesEOAssoc.SuppliersEO"
+ AssociationOtherEnd="model.entity.association.SuppliersEOToCoffeesEOAssoc.CoffeesEO"
+ Type="model.entity.SuppliersEOImpl"
+ IsUpdateable="true"/>
+ <Key
+ Name="SqliteAutoindexCoffeesfk1"
+ PrimaryKey="true">
+ <DesignTime>
+ <Attr Name="_DBObjectName" Value="sqlite_autoindex_COFFEESFK_1"/>
+ </DesignTime>
+ <AttrArray Name="Attributes">
+ <Item Value="model.entity.CoffeesEO.CofName"/>
+ </AttrArray>
+ </Key>
+ <Key
+ Name="fk_CoffeesEO">
+ <DesignTime>
+ <Attr Name="_referencedKey" Value="SUPPLIERSPK_PK"/>
+ <Attr Name="_isForeign" Value="true"/>
+ <Attr Name="_DBObjectName" Value="FK_COFFEES_EO"/>
+ <Attr Name="_isCascadeDelete" Value="true"/>
+ </DesignTime>
+ <AttrArray Name="Attributes">
+ <Item Value="model.entity.CoffeesEO.SupId"/>
+ </AttrArray>
+ </Key>
+</Entity>
diff --git a/examples/sql/adf/EX_ADF/Model/src/model/entity/CoffeesEOImpl.java b/examples/sql/adf/EX_ADF/Model/src/model/entity/CoffeesEOImpl.java
new file mode 100644
index 00000000..6f84c250
--- /dev/null
+++ b/examples/sql/adf/EX_ADF/Model/src/model/entity/CoffeesEOImpl.java
@@ -0,0 +1,281 @@
+package model.entity;
+
+import oracle.jbo.Key;
+import oracle.jbo.server.AttributeDefImpl;
+import oracle.jbo.server.EntityDefImpl;
+import oracle.jbo.server.EntityImpl;
+// ---------------------------------------------------------------------
+// --- File generated by Oracle ADF Business Components Design Time.
+// --- Mon Aug 19 12:01:47 CST 2013
+// --- Custom code may be added to this class.
+// --- Warning: Do not modify method signatures of generated methods.
+// ---------------------------------------------------------------------
+public class CoffeesEOImpl extends EntityImpl {
+ public void lock() {
+ //super.lock();
+ }
+
+ protected StringBuffer buildDMLStatement(int i, AttributeDefImpl[] attributeDefImpl,
+ AttributeDefImpl[] attributeDefImpl2,
+ AttributeDefImpl[] attributeDefImpl3, boolean b) {
+ StringBuffer stmt = super.buildDMLStatement(i, attributeDefImpl, attributeDefImpl2, attributeDefImpl3, b);
+ if (i == DML_UPDATE) {
+ // Get the alias name (it is equal to the entity definition name)
+ String alias = this.getEntityDef().getDefName();
+ // Remove the alias from the UPDATE statement
+ int index = stmt.indexOf( " " + alias + " SET ");
+ if (index != -1)
+ stmt = stmt.replace( index, index + alias.length() + 1, "");
+ }
+ return stmt;
+ }
+
+ /**
+ * AttributesEnum: generated enum for identifying attributes and accessors. Do not modify.
+ */
+ public enum AttributesEnum {
+ CofName {
+ public Object get(CoffeesEOImpl obj) {
+ return obj.getCofName();
+ }
+
+ public void put(CoffeesEOImpl obj, Object value) {
+ obj.setCofName((String)value);
+ }
+ }
+ ,
+ SupId {
+ public Object get(CoffeesEOImpl obj) {
+ return obj.getSupId();
+ }
+
+ public void put(CoffeesEOImpl obj, Object value) {
+ obj.setSupId((Integer)value);
+ }
+ }
+ ,
+ Price {
+ public Object get(CoffeesEOImpl obj) {
+ return obj.getPrice();
+ }
+
+ public void put(CoffeesEOImpl obj, Object value) {
+ obj.setPrice((Float)value);
+ }
+ }
+ ,
+ Sales {
+ public Object get(CoffeesEOImpl obj) {
+ return obj.getSales();
+ }
+
+ public void put(CoffeesEOImpl obj, Object value) {
+ obj.setSales((Integer)value);
+ }
+ }
+ ,
+ Total {
+ public Object get(CoffeesEOImpl obj) {
+ return obj.getTotal();
+ }
+
+ public void put(CoffeesEOImpl obj, Object value) {
+ obj.setTotal((Integer)value);
+ }
+ }
+ ,
+ SuppliersEO {
+ public Object get(CoffeesEOImpl obj) {
+ return obj.getSuppliersEO();
+ }
+
+ public void put(CoffeesEOImpl obj, Object value) {
+ obj.setSuppliersEO((SuppliersEOImpl)value);
+ }
+ }
+ ;
+ private static AttributesEnum[] vals = null;
+ private static int firstIndex = 0;
+
+ public abstract Object get(CoffeesEOImpl object);
+
+ public abstract void put(CoffeesEOImpl object, Object value);
+
+ public int index() {
+ return AttributesEnum.firstIndex() + ordinal();
+ }
+
+ public static int firstIndex() {
+ return firstIndex;
+ }
+
+ public static int count() {
+ return AttributesEnum.firstIndex() + AttributesEnum.staticValues().length;
+ }
+
+ public static AttributesEnum[] staticValues() {
+ if (vals == null) {
+ vals = AttributesEnum.values();
+ }
+ return vals;
+ }
+ }
+
+
+ public static final int COFNAME = AttributesEnum.CofName.index();
+ public static final int SUPID = AttributesEnum.SupId.index();
+ public static final int PRICE = AttributesEnum.Price.index();
+ public static final int SALES = AttributesEnum.Sales.index();
+ public static final int TOTAL = AttributesEnum.Total.index();
+ public static final int SUPPLIERSEO = AttributesEnum.SuppliersEO.index();
+
+ /**
+ * This is the default constructor (do not remove).
+ */
+ public CoffeesEOImpl() {
+ }
+
+
+ /**
+ * @return the definition object for this instance class.
+ */
+ public static synchronized EntityDefImpl getDefinitionObject() {
+ return EntityDefImpl.findDefObject("model.entity.CoffeesEO");
+ }
+
+ /**
+ * Gets the attribute value for CofName, using the alias name CofName.
+ * @return the value of CofName
+ */
+ public String getCofName() {
+ return (String)getAttributeInternal(COFNAME);
+ }
+
+ /**
+ * Sets <code>value</code> as the attribute value for CofName.
+ * @param value value to set the CofName
+ */
+ public void setCofName(String value) {
+ setAttributeInternal(COFNAME, value);
+ }
+
+ /**
+ * Gets the attribute value for SupId, using the alias name SupId.
+ * @return the value of SupId
+ */
+ public Integer getSupId() {
+ return (Integer)getAttributeInternal(SUPID);
+ }
+
+ /**
+ * Sets <code>value</code> as the attribute value for SupId.
+ * @param value value to set the SupId
+ */
+ public void setSupId(Integer value) {
+ setAttributeInternal(SUPID, value);
+ }
+
+ /**
+ * Gets the attribute value for Price, using the alias name Price.
+ * @return the value of Price
+ */
+ public Float getPrice() {
+ return (Float)getAttributeInternal(PRICE);
+ }
+
+ /**
+ * Sets <code>value</code> as the attribute value for Price.
+ * @param value value to set the Price
+ */
+ public void setPrice(Float value) {
+ setAttributeInternal(PRICE, value);
+ }
+
+ /**
+ * Gets the attribute value for Sales, using the alias name Sales.
+ * @return the value of Sales
+ */
+ public Integer getSales() {
+ return (Integer)getAttributeInternal(SALES);
+ }
+
+ /**
+ * Sets <code>value</code> as the attribute value for Sales.
+ * @param value value to set the Sales
+ */
+ public void setSales(Integer value) {
+ setAttributeInternal(SALES, value);
+ }
+
+ /**
+ * Gets the attribute value for Total, using the alias name Total.
+ * @return the value of Total
+ */
+ public Integer getTotal() {
+ return (Integer)getAttributeInternal(TOTAL);
+ }
+
+ /**
+ * Sets <code>value</code> as the attribute value for Total.
+ * @param value value to set the Total
+ */
+ public void setTotal(Integer value) {
+ setAttributeInternal(TOTAL, value);
+ }
+
+ /**
+ * getAttrInvokeAccessor: generated method. Do not modify.
+ * @param index the index identifying the attribute
+ * @param attrDef the attribute
+
+ * @return the attribute value
+ * @throws Exception
+ */
+ protected Object getAttrInvokeAccessor(int index, AttributeDefImpl attrDef) throws Exception {
+ if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {
+ return AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].get(this);
+ }
+ return super.getAttrInvokeAccessor(index, attrDef);
+ }
+
+ /**
+ * setAttrInvokeAccessor: generated method. Do not modify.
+ * @param index the index identifying the attribute
+ * @param value the value to assign to the attribute
+ * @param attrDef the attribute
+
+ * @throws Exception
+ */
+ protected void setAttrInvokeAccessor(int index, Object value, AttributeDefImpl attrDef) throws Exception {
+ if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {
+ AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);
+ return;
+ }
+ super.setAttrInvokeAccessor(index, value, attrDef);
+ }
+
+ /**
+ * @return the associated entity SuppliersEOImpl.
+ */
+ public SuppliersEOImpl getSuppliersEO() {
+ return (SuppliersEOImpl)getAttributeInternal(SUPPLIERSEO);
+ }
+
+ /**
+ * Sets <code>value</code> as the associated entity SuppliersEOImpl.
+ */
+ public void setSuppliersEO(SuppliersEOImpl value) {
+ setAttributeInternal(SUPPLIERSEO, value);
+ }
+
+ /**
+ * @param cofName key constituent
+
+ * @return a Key object based on given key constituents.
+ */
+ public static Key createPrimaryKey(String cofName) {
+ return new Key(new Object[]{cofName});
+ }
+
+
+}
diff --git a/examples/sql/adf/EX_ADF/Model/src/model/entity/SuppliersEO.xml b/examples/sql/adf/EX_ADF/Model/src/model/entity/SuppliersEO.xml
new file mode 100644
index 00000000..3ad0b5f9
--- /dev/null
+++ b/examples/sql/adf/EX_ADF/Model/src/model/entity/SuppliersEO.xml
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="GBK" ?>
+<!DOCTYPE Entity SYSTEM "jbo_03_01.dtd">
+<!---->
+<Entity
+ xmlns="http://xmlns.oracle.com/bc4j"
+ Name="SuppliersEO"
+ Version="11.1.2.64.36"
+ DBObjectType="TABLE"
+ DBObjectName="SUPPLIERSPK"
+ AliasName="SuppliersEO"
+ BindingStyle="JDBC"
+ UseGlueCode="false"
+ RowClass="model.entity.SuppliersEOImpl">
+ <DesignTime>
+ <Attr Name="_codeGenFlag2" Value="Access"/>
+ <Attr Name="_isCodegen" Value="true"/>
+ </DesignTime>
+ <Attribute
+ Name="SupId"
+ IsNotNull="true"
+ ColumnName="SUP_ID"
+ SQLType="INTEGER"
+ Type="java.lang.Integer"
+ ColumnType="INTEGER"
+ TableName="SUPPLIERSPK"
+ PrimaryKey="true"/>
+ <Attribute
+ Name="SupName"
+ ColumnName="SUP_NAME"
+ SQLType="VARCHAR"
+ Type="java.lang.String"
+ ColumnType="VARCHAR"
+ TableName="SUPPLIERSPK"/>
+ <Attribute
+ Name="Street"
+ ColumnName="STREET"
+ SQLType="VARCHAR"
+ Type="java.lang.String"
+ ColumnType="VARCHAR"
+ TableName="SUPPLIERSPK"/>
+ <Attribute
+ Name="City"
+ ColumnName="CITY"
+ SQLType="VARCHAR"
+ Type="java.lang.String"
+ ColumnType="VARCHAR"
+ TableName="SUPPLIERSPK"/>
+ <Attribute
+ Name="State"
+ ColumnName="STATE"
+ SQLType="VARCHAR"
+ Type="java.lang.String"
+ ColumnType="VARCHAR"
+ TableName="SUPPLIERSPK"/>
+ <Attribute
+ Name="Zip"
+ ColumnName="ZIP"
+ SQLType="VARCHAR"
+ Type="java.lang.String"
+ ColumnType="VARCHAR"
+ TableName="SUPPLIERSPK"/>
+ <AccessorAttribute
+ Name="CoffeesEO"
+ Association="model.entity.association.SuppliersEOToCoffeesEOAssoc"
+ AssociationEnd="model.entity.association.SuppliersEOToCoffeesEOAssoc.CoffeesEO"
+ AssociationOtherEnd="model.entity.association.SuppliersEOToCoffeesEOAssoc.SuppliersEO"
+ Type="oracle.jbo.RowIterator"
+ IsUpdateable="false"/>
+ <Key
+ Name="SupplierspkPk"
+ PrimaryKey="true">
+ <DesignTime>
+ <Attr Name="_DBObjectName" Value="SUPPLIERSPK_PK"/>
+ </DesignTime>
+ <AttrArray Name="Attributes">
+ <Item Value="model.entity.SuppliersEO.SupId"/>
+ </AttrArray>
+ </Key>
+</Entity>
diff --git a/examples/sql/adf/EX_ADF/Model/src/model/entity/SuppliersEOImpl.java b/examples/sql/adf/EX_ADF/Model/src/model/entity/SuppliersEOImpl.java
new file mode 100644
index 00000000..92449faa
--- /dev/null
+++ b/examples/sql/adf/EX_ADF/Model/src/model/entity/SuppliersEOImpl.java
@@ -0,0 +1,302 @@
+package model.entity;
+
+import oracle.jbo.Key;
+import oracle.jbo.RowIterator;
+import oracle.jbo.server.AttributeDefImpl;
+import oracle.jbo.server.EntityDefImpl;
+import oracle.jbo.server.EntityImpl;
+// ---------------------------------------------------------------------
+// --- File generated by Oracle ADF Business Components Design Time.
+// --- Mon Aug 19 12:03:06 CST 2013
+// --- Custom code may be added to this class.
+// --- Warning: Do not modify method signatures of generated methods.
+// ---------------------------------------------------------------------
+public class SuppliersEOImpl extends EntityImpl {
+ public void lock() {
+ //super.lock();
+ }
+
+ protected StringBuffer buildDMLStatement(int i, AttributeDefImpl[] attributeDefImpl,
+ AttributeDefImpl[] attributeDefImpl2,
+ AttributeDefImpl[] attributeDefImpl3, boolean b) {
+ StringBuffer stmt = super.buildDMLStatement(i, attributeDefImpl, attributeDefImpl2, attributeDefImpl3, b);
+ if (i == DML_UPDATE) {
+ // Get the alias name (it is equal to the entity definition name)
+ String alias = this.getEntityDef().getDefName();
+ // Remove the alias from the UPDATE statement
+ int index = stmt.indexOf( " " + alias + " SET ");
+ if (index != -1)
+ stmt = stmt.replace( index, index + alias.length() + 1, "");
+ }
+ return stmt;
+ }
+
+ /**
+ * AttributesEnum: generated enum for identifying attributes and accessors. Do not modify.
+ */
+ public enum AttributesEnum {
+ SupId {
+ public Object get(SuppliersEOImpl obj) {
+ return obj.getSupId();
+ }
+
+ public void put(SuppliersEOImpl obj, Object value) {
+ obj.setSupId((Integer)value);
+ }
+ }
+ ,
+ SupName {
+ public Object get(SuppliersEOImpl obj) {
+ return obj.getSupName();
+ }
+
+ public void put(SuppliersEOImpl obj, Object value) {
+ obj.setSupName((String)value);
+ }
+ }
+ ,
+ Street {
+ public Object get(SuppliersEOImpl obj) {
+ return obj.getStreet();
+ }
+
+ public void put(SuppliersEOImpl obj, Object value) {
+ obj.setStreet((String)value);
+ }
+ }
+ ,
+ City {
+ public Object get(SuppliersEOImpl obj) {
+ return obj.getCity();
+ }
+
+ public void put(SuppliersEOImpl obj, Object value) {
+ obj.setCity((String)value);
+ }
+ }
+ ,
+ State {
+ public Object get(SuppliersEOImpl obj) {
+ return obj.getState();
+ }
+
+ public void put(SuppliersEOImpl obj, Object value) {
+ obj.setState((String)value);
+ }
+ }
+ ,
+ Zip {
+ public Object get(SuppliersEOImpl obj) {
+ return obj.getZip();
+ }
+
+ public void put(SuppliersEOImpl obj, Object value) {
+ obj.setZip((String)value);
+ }
+ }
+ ,
+ CoffeesEO {
+ public Object get(SuppliersEOImpl obj) {
+ return obj.getCoffeesEO();
+ }
+
+ public void put(SuppliersEOImpl obj, Object value) {
+ obj.setAttributeInternal(index(), value);
+ }
+ }
+ ;
+ private static AttributesEnum[] vals = null;
+ private static int firstIndex = 0;
+
+ public abstract Object get(SuppliersEOImpl object);
+
+ public abstract void put(SuppliersEOImpl object, Object value);
+
+ public int index() {
+ return AttributesEnum.firstIndex() + ordinal();
+ }
+
+ public static int firstIndex() {
+ return firstIndex;
+ }
+
+ public static int count() {
+ return AttributesEnum.firstIndex() + AttributesEnum.staticValues().length;
+ }
+
+ public static AttributesEnum[] staticValues() {
+ if (vals == null) {
+ vals = AttributesEnum.values();
+ }
+ return vals;
+ }
+ }
+
+
+ public static final int SUPID = AttributesEnum.SupId.index();
+ public static final int SUPNAME = AttributesEnum.SupName.index();
+ public static final int STREET = AttributesEnum.Street.index();
+ public static final int CITY = AttributesEnum.City.index();
+ public static final int STATE = AttributesEnum.State.index();
+ public static final int ZIP = AttributesEnum.Zip.index();
+ public static final int COFFEESEO = AttributesEnum.CoffeesEO.index();
+
+ /**
+ * This is the default constructor (do not remove).
+ */
+ public SuppliersEOImpl() {
+ }
+
+
+ /**
+ * @return the definition object for this instance class.
+ */
+ public static synchronized EntityDefImpl getDefinitionObject() {
+ return EntityDefImpl.findDefObject("model.entity.SuppliersEO");
+ }
+
+ /**
+ * Gets the attribute value for SupId, using the alias name SupId.
+ * @return the value of SupId
+ */
+ public Integer getSupId() {
+ return (Integer)getAttributeInternal(SUPID);
+ }
+
+ /**
+ * Sets <code>value</code> as the attribute value for SupId.
+ * @param value value to set the SupId
+ */
+ public void setSupId(Integer value) {
+ setAttributeInternal(SUPID, value);
+ }
+
+ /**
+ * Gets the attribute value for SupName, using the alias name SupName.
+ * @return the value of SupName
+ */
+ public String getSupName() {
+ return (String)getAttributeInternal(SUPNAME);
+ }
+
+ /**
+ * Sets <code>value</code> as the attribute value for SupName.
+ * @param value value to set the SupName
+ */
+ public void setSupName(String value) {
+ setAttributeInternal(SUPNAME, value);
+ }
+
+ /**
+ * Gets the attribute value for Street, using the alias name Street.
+ * @return the value of Street
+ */
+ public String getStreet() {
+ return (String)getAttributeInternal(STREET);
+ }
+
+ /**
+ * Sets <code>value</code> as the attribute value for Street.
+ * @param value value to set the Street
+ */
+ public void setStreet(String value) {
+ setAttributeInternal(STREET, value);
+ }
+
+ /**
+ * Gets the attribute value for City, using the alias name City.
+ * @return the value of City
+ */
+ public String getCity() {
+ return (String)getAttributeInternal(CITY);
+ }
+
+ /**
+ * Sets <code>value</code> as the attribute value for City.
+ * @param value value to set the City
+ */
+ public void setCity(String value) {
+ setAttributeInternal(CITY, value);
+ }
+
+ /**
+ * Gets the attribute value for State, using the alias name State.
+ * @return the value of State
+ */
+ public String getState() {
+ return (String)getAttributeInternal(STATE);
+ }
+
+ /**
+ * Sets <code>value</code> as the attribute value for State.
+ * @param value value to set the State
+ */
+ public void setState(String value) {
+ setAttributeInternal(STATE, value);
+ }
+
+ /**
+ * Gets the attribute value for Zip, using the alias name Zip.
+ * @return the value of Zip
+ */
+ public String getZip() {
+ return (String)getAttributeInternal(ZIP);
+ }
+
+ /**
+ * Sets <code>value</code> as the attribute value for Zip.
+ * @param value value to set the Zip
+ */
+ public void setZip(String value) {
+ setAttributeInternal(ZIP, value);
+ }
+
+ /**
+ * getAttrInvokeAccessor: generated method. Do not modify.
+ * @param index the index identifying the attribute
+ * @param attrDef the attribute
+
+ * @return the attribute value
+ * @throws Exception
+ */
+ protected Object getAttrInvokeAccessor(int index, AttributeDefImpl attrDef) throws Exception {
+ if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {
+ return AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].get(this);
+ }
+ return super.getAttrInvokeAccessor(index, attrDef);
+ }
+
+ /**
+ * setAttrInvokeAccessor: generated method. Do not modify.
+ * @param index the index identifying the attribute
+ * @param value the value to assign to the attribute
+ * @param attrDef the attribute
+
+ * @throws Exception
+ */
+ protected void setAttrInvokeAccessor(int index, Object value, AttributeDefImpl attrDef) throws Exception {
+ if ((index >= AttributesEnum.firstIndex()) && (index < AttributesEnum.count())) {
+ AttributesEnum.staticValues()[index - AttributesEnum.firstIndex()].put(this, value);
+ return;
+ }
+ super.setAttrInvokeAccessor(index, value, attrDef);
+ }
+
+ /**
+ * @return the associated entity oracle.jbo.RowIterator.
+ */
+ public RowIterator getCoffeesEO() {
+ return (RowIterator)getAttributeInternal(COFFEESEO);
+ }
+
+ /**
+ * @param supId key constituent
+
+ * @return a Key object based on given key constituents.
+ */
+ public static Key createPrimaryKey(Integer supId) {
+ return new Key(new Object[]{supId});
+ }
+
+
+}
diff --git a/examples/sql/adf/EX_ADF/Model/src/model/entity/association/SuppliersEOToCoffeesEOAssoc.xml b/examples/sql/adf/EX_ADF/Model/src/model/entity/association/SuppliersEOToCoffeesEOAssoc.xml
new file mode 100644
index 00000000..19550461
--- /dev/null
+++ b/examples/sql/adf/EX_ADF/Model/src/model/entity/association/SuppliersEOToCoffeesEOAssoc.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="GBK" ?>
+<!DOCTYPE Association SYSTEM "jbo_03_01.dtd">
+<!---->
+<Association
+ xmlns="http://xmlns.oracle.com/bc4j"
+ Name="SuppliersEOToCoffeesEOAssoc"
+ Version="11.1.2.64.36">
+ <DesignTime>
+ <Attr Name="_isCodegen" Value="true"/>
+ </DesignTime>
+ <AssociationEnd
+ Name="SuppliersEO"
+ Cardinality="1"
+ Source="true"
+ Owner="model.entity.SuppliersEO"
+ CascadeDelete="true"
+ DeleteContainee="true"
+ CascadeUpdate="true">
+ <DesignTime>
+ <Attr Name="_aggregation" Value="0"/>
+ <Attr Name="_finderName" Value="SuppliersEO"/>
+ <Attr Name="_foreignKey" Value="model.entity.SuppliersEO.SupplierspkPk"/>
+ <Attr Name="_isUpdateable" Value="true"/>
+ <Attr Name="_minCardinality" Value="1"/>
+ </DesignTime>
+ <AttrArray Name="Attributes">
+ <Item Value="model.entity.SuppliersEO.SupId"/>
+ </AttrArray>
+ </AssociationEnd>
+ <AssociationEnd
+ Name="CoffeesEO"
+ Cardinality="-1"
+ Owner="model.entity.CoffeesEO"
+ HasOwner="true">
+ <DesignTime>
+ <Attr Name="_aggregation" Value="0"/>
+ <Attr Name="_finderName" Value="CoffeesEO"/>
+ <Attr Name="_foreignKey" Value="model.entity.CoffeesEO.fk_CoffeesEO"/>
+ <Attr Name="_isUpdateable" Value="true"/>
+ </DesignTime>
+ <AttrArray Name="Attributes">
+ <Item Value="model.entity.CoffeesEO.SupId"/>
+ </AttrArray>
+ </AssociationEnd>
+</Association>
diff --git a/examples/sql/adf/EX_ADF/Model/src/uimodel/am/AppModule.xml b/examples/sql/adf/EX_ADF/Model/src/uimodel/am/AppModule.xml
new file mode 100644
index 00000000..de3eb6b9
--- /dev/null
+++ b/examples/sql/adf/EX_ADF/Model/src/uimodel/am/AppModule.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="GBK" ?>
+<!DOCTYPE AppModule SYSTEM "jbo_03_01.dtd">
+<!---->
+<AppModule
+ xmlns="http://xmlns.oracle.com/bc4j"
+ Name="AppModule"
+ Version="11.1.2.64.36"
+ ClearCacheOnRollback="true">
+ <Properties>
+ <SchemaBasedProperties>
+ <LABEL
+ ResId="uimodel.am.AppModule_LABEL"/>
+ </SchemaBasedProperties>
+ </Properties>
+ <ViewUsage
+ Name="Coffees"
+ ViewObjectName="uimodel.view.CoffeesVO"/>
+ <ViewUsage
+ Name="Suppliers"
+ ViewObjectName="uimodel.view.SuppliersVO"/>
+ <ViewUsage
+ Name="CoffeesForSuppliers"
+ ViewObjectName="uimodel.view.CoffeesVO"/>
+ <ViewLinkUsage
+ Name="SuppliersVOToCoffeesVOLink1"
+ ViewLinkObjectName="uimodel.view.SuppliersVOToCoffeesVOLink"
+ SrcViewUsageName="uimodel.am.AppModule.Suppliers"
+ DstViewUsageName="uimodel.am.AppModule.CoffeesForSuppliers"
+ Reversed="false"/>
+ <ResourceBundle>
+ <PropertiesBundle
+ PropertiesFile="model.ModelBundle"/>
+ </ResourceBundle>
+</AppModule>
diff --git a/examples/sql/adf/EX_ADF/Model/src/uimodel/am/TestClient.java b/examples/sql/adf/EX_ADF/Model/src/uimodel/am/TestClient.java
new file mode 100644
index 00000000..dc8df900
--- /dev/null
+++ b/examples/sql/adf/EX_ADF/Model/src/uimodel/am/TestClient.java
@@ -0,0 +1,179 @@
+/*-
+ * See the file LICENSE for redistribution information.
+ *
+ * Copyright (c) 2013, 2015 Oracle and/or its affiliates. All rights reserved.
+ *
+ */
+
+package uimodel.am;
+
+import oracle.jbo.ApplicationModule;
+import oracle.jbo.Key;
+import oracle.jbo.Row;
+import oracle.jbo.RowMatch;
+import oracle.jbo.ViewCriteria;
+import oracle.jbo.ViewCriteriaRow;
+import oracle.jbo.ViewObject;
+import oracle.jbo.client.Configuration;
+
+public class TestClient {
+ public static void main(String[] args) {
+
+ String amDef = "uimodel.am.AppModule";
+ String config = "AppModuleLocal";
+ ApplicationModule am =
+ Configuration.createRootApplicationModule(amDef, config);
+
+ ViewObject cofVO = am.findViewObject("Coffees");
+ ViewObject supVO = am.findViewObject("Suppliers");
+ cofVO.executeQuery();
+ supVO.executeQuery();
+ showRows(cofVO, "Initial database results - Coffees");
+ showRows(supVO, "Initial database results - Suppliers");
+
+ // Test sorting rows.
+ System.out.println("\n=== " + " Test sorting rows " + " ===\n");
+ cofVO.setSortBy("Price desc");
+ cofVO.setQueryMode(ViewObject.QUERY_MODE_SCAN_VIEW_ROWS);
+ cofVO.executeQuery();
+ showRows(cofVO, "Sorting Coffees by Price desc");
+
+ supVO.setSortBy("Zip asc");
+ supVO.setQueryMode(ViewObject.QUERY_MODE_SCAN_VIEW_ROWS);
+ supVO.executeQuery();
+ showRows(supVO, "Sorting Suppliers by Zip asc");
+ System.out.println("\n=== " + " End " + " ===\n");
+
+ // Test matching rows.
+ System.out.println("\n=== " + " Test matching rows " + " ===\n");
+ cofVO.setSortBy("");
+ supVO.setSortBy("");
+
+ RowMatch rm = new RowMatch("CofName like 'C%'");
+ cofVO.setRowMatch(rm);
+ cofVO.executeQuery();
+ showRows(cofVO, "Coffee Name begins with 'C'");
+
+ rm = new RowMatch("Zip like '95%'");
+ supVO.setRowMatch(rm);
+ supVO.executeQuery();
+ showRows(supVO, "Supplier Zip begins with '95'");
+ System.out.println("\n=== " + " End " + " ===\n");
+
+ // Test filtering rows by view criteria.
+ System.out.println("\n=== " +
+ " Test filtering rows by view criteria " + " ===\n");
+ cofVO.setRowMatch(null);
+
+ ViewCriteria vc = cofVO.createViewCriteria();
+ ViewCriteriaRow vcr = vc.createViewCriteriaRow();
+ vcr.setAttribute("SupId", "= 150");
+ vc.add(vcr);
+ cofVO.applyViewCriteria(vc);
+ vc.setCriteriaMode(ViewCriteria.CRITERIA_MODE_CACHE);
+ cofVO.setQueryMode(ViewObject.QUERY_MODE_SCAN_ENTITY_ROWS);
+ cofVO.executeQuery();
+ showRows(cofVO, "Supplier ID = 150");
+ System.out.println("\n=== " + " End " + " ===\n");
+
+ // Test inserting a row with the foreign key.
+ System.out.println("\n=== " +
+ " Test insert with a foreign key " + " ===\n");
+ cofVO.applyViewCriteria(null);
+
+ cofVO.setSortBy("SupId");
+ cofVO.setQueryMode(ViewObject.QUERY_MODE_SCAN_VIEW_ROWS);
+ cofVO.executeQuery();
+ showRows(cofVO, "Before insert and clear cache, query over VO cache");
+ cofVO.setQueryMode(ViewObject.QUERY_MODE_SCAN_ENTITY_ROWS);
+ cofVO.executeQuery();
+ showRows(cofVO, "Before insert and clear cache, query over EO cache");
+
+ cofVO.setAssociationConsistent(true);
+ Row newCof = cofVO.createRow();
+ newCof.setAttribute("CofName", "Java_Chips_Mocha");
+ newCof.setAttribute("Price", "5.99");
+ newCof.setAttribute("Sales", "5");
+ newCof.setAttribute("Total", "9");
+ try {
+ newCof.setAttribute("SupId", "10");
+ System.out.println("Setting an invalid foreign key should fail.");
+ return;
+ } catch (Exception e) {
+ }
+ newCof.setAttribute("SupId", "101");
+ cofVO.insertRow(newCof);
+ cofVO.setQueryMode(ViewObject.QUERY_MODE_SCAN_VIEW_ROWS);
+ cofVO.clearCache();
+ showRows(cofVO, "After insert and clear cache, query over VO cache");
+
+ cofVO.setQueryMode(ViewObject.QUERY_MODE_SCAN_ENTITY_ROWS);
+ cofVO.executeQuery();
+ showRows(cofVO, "After insert and clear cache, query over EO cache");
+ System.out.println("\n=== " + " End " + " ===\n");
+
+ // Test updating a row.
+ System.out.println("\n=== " + " Test updating a row " + " ===\n");
+ showRows(cofVO, "Before update");
+
+ newCof.setAttribute("Price", "15.99");
+ cofVO.clearCache();
+ showRows(cofVO, "After update");
+ System.out.println("\n=== " + " End " + " ===\n");
+
+ // Test deleting a row in SUPPLIERSPK and all rows referencing
+ // the same SupId in COFFEESFK will be deleted automactially.
+ System.out.println("\n=== " + " Test deleting rows " + " ===\n");
+ supVO.setRowMatch(null);
+ supVO.setQueryMode(ViewObject.QUERY_MODE_SCAN_ENTITY_ROWS);
+ supVO.executeQuery();
+ showRows(supVO, "Before delete in SUPPLIERS - Suppliers");
+ showRows(cofVO, "Before delete in SUPPLIERS - Coffees");
+
+ supVO.setAssociationConsistent(true);
+ Object[] keyValues = new Object[6];
+ keyValues[0] = new Integer(49);
+ for (int i = 1; i < keyValues.length; i++)
+ keyValues[i] = null;
+ Row[] rows = supVO.findByKey(new Key(keyValues), 1);
+ rows[0].remove();
+ supVO.setQueryMode(ViewObject.QUERY_MODE_SCAN_ENTITY_ROWS);
+ supVO.executeQuery();
+ showRows(supVO, "After delete in SUPPLIERS - Suppliers");
+ showRows(cofVO, "After delete in SUPPLIERS - Coffees");
+ System.out.println("\n=== " + " End " + " ===\n");
+
+ Configuration.releaseRootApplicationModule(am, true);
+ }
+
+ private static void showRows(ViewObject vo, String msg) {
+ System.out.println("\n--- " + msg + " ---\n");
+ boolean prtCof = false;
+ if (vo.getFullName().contains("Coffees") == true)
+ prtCof = true;
+ String prtStr;
+ vo.reset();
+ while (vo.hasNext()) {
+ Row r = vo.next();
+ if (prtCof == true) {
+ String name = (String)r.getAttribute("CofName");
+ Integer id = (Integer)r.getAttribute("SupId");
+ Float price = (Float)r.getAttribute("Price");
+ Integer sales = (Integer)r.getAttribute("Sales");
+ Integer total = (Integer)r.getAttribute("Total");
+ prtStr = name + ", " + id + ", " +
+ price + ", " + sales + ", " + total;
+ } else {
+ Integer id = (Integer)r.getAttribute("SupId");
+ String name = (String)r.getAttribute("SupName");
+ String street = (String)r.getAttribute("Street");
+ String city = (String)r.getAttribute("City");
+ String state = (String)r.getAttribute("State");
+ String zip = (String)r.getAttribute("Zip");
+ prtStr = id + ", " + name + ", " +
+ street + ", " + city + ", " + state + ", " + zip;
+ }
+ System.out.println(prtStr);
+ }
+ }
+}
diff --git a/examples/sql/adf/EX_ADF/Model/src/uimodel/am/common/bc4j.xcfg b/examples/sql/adf/EX_ADF/Model/src/uimodel/am/common/bc4j.xcfg
new file mode 100644
index 00000000..0a352109
--- /dev/null
+++ b/examples/sql/adf/EX_ADF/Model/src/uimodel/am/common/bc4j.xcfg
@@ -0,0 +1,15 @@
+<?xml version = '1.0' encoding = 'UTF-8'?>
+<BC4JConfig version="11.1" xmlns="http://xmlns.oracle.com/bc4j/configuration">
+ <AppModuleConfigBag ApplicationName="uimodel.am.AppModule">
+ <AppModuleConfig name="AppModuleShared" jbo.project="model.Model" DeployPlatform="LOCAL" ApplicationName="uimodel.am.AppModule">
+ <AM-Pooling jbo.ampool.maxpoolsize="1" jbo.ampool.dynamicjdbccredentials="false" jbo.ampool.isuseexclusive="false" jbo.ampool.resetnontransactionalstate="false"/>
+ <Database jbo.locking.mode="optimistic" jbo.TypeMapEntries="Java" jbo.sql92.JdbcDriverClass="SQLite.JDBCDriver" jbo.SQLBuilder="SQL92"/>
+ <Security AppModuleJndiName="uimodel.am.AppModule"/>
+ <Custom JDBCDataSource="java:comp/env/jdbc/BDBConnectionDS"/>
+ </AppModuleConfig>
+ <AppModuleConfig name="AppModuleLocal" DeployPlatform="LOCAL" JDBCName="BDBConnection" jbo.project="model.Model" ApplicationName="uimodel.am.AppModule">
+ <Database jbo.sql92.JdbcDriverClass="SQLite.JDBCDriver" jbo.TypeMapEntries="Java" jbo.locking.mode="optimistic" jbo.SQLBuilder="SQL92"/>
+ <Security AppModuleJndiName="uimodel.am.AppModule"/>
+ </AppModuleConfig>
+ </AppModuleConfigBag>
+</BC4JConfig>
diff --git a/examples/sql/adf/EX_ADF/Model/src/uimodel/view/CoffeesVO.xml b/examples/sql/adf/EX_ADF/Model/src/uimodel/view/CoffeesVO.xml
new file mode 100644
index 00000000..b25195b2
--- /dev/null
+++ b/examples/sql/adf/EX_ADF/Model/src/uimodel/view/CoffeesVO.xml
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="GBK" ?>
+<!DOCTYPE ViewObject SYSTEM "jbo_03_01.dtd">
+<!---->
+<ViewObject
+ xmlns="http://xmlns.oracle.com/bc4j"
+ Name="CoffeesVO"
+ Version="11.1.2.64.36"
+ SelectList="CoffeesEO.COF_NAME,
+ CoffeesEO.SUP_ID,
+ CoffeesEO.PRICE,
+ CoffeesEO.SALES,
+ CoffeesEO.TOTAL"
+ FromList="COFFEESFK CoffeesEO"
+ BindingStyle="JDBC"
+ CustomQuery="false"
+ PageIterMode="Full"
+ UseGlueCode="false">
+ <Properties>
+ <SchemaBasedProperties>
+ <LABEL
+ ResId="uimodel.view.CoffeesVO_LABEL"/>
+ </SchemaBasedProperties>
+ </Properties>
+ <ViewAccessor
+ Name="SuppliersVOAccessor"
+ ViewObjectName="uimodel.view.SuppliersVO"
+ RowLevelBinds="true"/>
+ <ListBinding
+ Name="LOV_SupId"
+ ListVOName="SuppliersVOAccessor"
+ ListRangeSize="-1"
+ NullValueFlag="start"
+ NullValueId="LOV_SupId_LOVUIHints_NullValueId"
+ MRUCount="0">
+ <AttrArray Name="AttrNames">
+ <Item Value="SupId"/>
+ </AttrArray>
+ <AttrArray Name="ListAttrNames">
+ <Item Value="SupId"/>
+ </AttrArray>
+ <AttrArray Name="ListDisplayAttrNames">
+ <Item Value="SupId"/>
+ </AttrArray>
+ <DisplayCriteria/>
+ </ListBinding>
+ <EntityUsage
+ Name="CoffeesEO"
+ Entity="model.entity.CoffeesEO"/>
+ <ViewAttribute
+ Name="CofName"
+ IsNotNull="true"
+ PrecisionRule="true"
+ EntityAttrName="CofName"
+ EntityUsage="CoffeesEO"
+ AliasName="COF_NAME"/>
+ <ViewAttribute
+ Name="SupId"
+ PrecisionRule="true"
+ EntityAttrName="SupId"
+ EntityUsage="CoffeesEO"
+ AliasName="SUP_ID"
+ LOVName="LOV_SupId"
+ DefaultValue="49">
+ <RecalcCondition><![CDATA[true]]></RecalcCondition>
+ <Properties>
+ <SchemaBasedProperties>
+ <CONTROLTYPE
+ Value="choice"/>
+ </SchemaBasedProperties>
+ </Properties>
+ </ViewAttribute>
+ <ViewAttribute
+ Name="Price"
+ PrecisionRule="true"
+ EntityAttrName="Price"
+ EntityUsage="CoffeesEO"
+ AliasName="PRICE"/>
+ <ViewAttribute
+ Name="Sales"
+ PrecisionRule="true"
+ EntityAttrName="Sales"
+ EntityUsage="CoffeesEO"
+ AliasName="SALES"/>
+ <ViewAttribute
+ Name="Total"
+ PrecisionRule="true"
+ EntityAttrName="Total"
+ EntityUsage="CoffeesEO"
+ AliasName="TOTAL"/>
+ <ResourceBundle>
+ <PropertiesBundle
+ PropertiesFile="model.ModelBundle"/>
+ </ResourceBundle>
+</ViewObject>
diff --git a/examples/sql/adf/EX_ADF/Model/src/uimodel/view/SuppliersVO.xml b/examples/sql/adf/EX_ADF/Model/src/uimodel/view/SuppliersVO.xml
new file mode 100644
index 00000000..68a383c6
--- /dev/null
+++ b/examples/sql/adf/EX_ADF/Model/src/uimodel/view/SuppliersVO.xml
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="GBK" ?>
+<!DOCTYPE ViewObject SYSTEM "jbo_03_01.dtd">
+<!---->
+<ViewObject
+ xmlns="http://xmlns.oracle.com/bc4j"
+ Name="SuppliersVO"
+ Version="11.1.2.64.36"
+ SelectList="SuppliersEO.SUP_ID,
+ SuppliersEO.SUP_NAME,
+ SuppliersEO.STREET,
+ SuppliersEO.CITY,
+ SuppliersEO.STATE,
+ SuppliersEO.ZIP"
+ FromList="SUPPLIERSPK SuppliersEO"
+ BindingStyle="JDBC"
+ CustomQuery="false"
+ PageIterMode="Full"
+ UseGlueCode="false">
+ <Properties>
+ <SchemaBasedProperties>
+ <LABEL
+ ResId="uimodel.view.SuppliersVO_LABEL"/>
+ </SchemaBasedProperties>
+ </Properties>
+ <EntityUsage
+ Name="SuppliersEO"
+ Entity="model.entity.SuppliersEO"/>
+ <ViewAttribute
+ Name="SupId"
+ IsNotNull="true"
+ PrecisionRule="true"
+ EntityAttrName="SupId"
+ EntityUsage="SuppliersEO"
+ AliasName="SUP_ID"/>
+ <ViewAttribute
+ Name="SupName"
+ PrecisionRule="true"
+ EntityAttrName="SupName"
+ EntityUsage="SuppliersEO"
+ AliasName="SUP_NAME"/>
+ <ViewAttribute
+ Name="Street"
+ PrecisionRule="true"
+ EntityAttrName="Street"
+ EntityUsage="SuppliersEO"
+ AliasName="STREET"/>
+ <ViewAttribute
+ Name="City"
+ PrecisionRule="true"
+ EntityAttrName="City"
+ EntityUsage="SuppliersEO"
+ AliasName="CITY"/>
+ <ViewAttribute
+ Name="State"
+ PrecisionRule="true"
+ EntityAttrName="State"
+ EntityUsage="SuppliersEO"
+ AliasName="STATE"/>
+ <ViewAttribute
+ Name="Zip"
+ PrecisionRule="true"
+ EntityAttrName="Zip"
+ EntityUsage="SuppliersEO"
+ AliasName="ZIP"/>
+ <ViewLinkAccessor
+ Name="CoffeesVO"
+ ViewLink="uimodel.view.SuppliersVOToCoffeesVOLink"
+ Type="oracle.jbo.RowIterator"
+ IsUpdateable="false"/>
+ <ResourceBundle>
+ <PropertiesBundle
+ PropertiesFile="model.ModelBundle"/>
+ </ResourceBundle>
+</ViewObject>
diff --git a/examples/sql/adf/EX_ADF/Model/src/uimodel/view/SuppliersVOToCoffeesVOLink.xml b/examples/sql/adf/EX_ADF/Model/src/uimodel/view/SuppliersVOToCoffeesVOLink.xml
new file mode 100644
index 00000000..f4907aa7
--- /dev/null
+++ b/examples/sql/adf/EX_ADF/Model/src/uimodel/view/SuppliersVOToCoffeesVOLink.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="GBK" ?>
+<!DOCTYPE ViewLink SYSTEM "jbo_03_01.dtd">
+<!---->
+<ViewLink
+ xmlns="http://xmlns.oracle.com/bc4j"
+ Name="SuppliersVOToCoffeesVOLink"
+ Version="11.1.2.64.36">
+ <Properties>
+ <SchemaBasedProperties>
+ <LABEL
+ ResId="uimodel.view.SuppliersVOToCoffeesVOLink_LABEL"/>
+ </SchemaBasedProperties>
+ </Properties>
+ <ViewLinkDefEnd
+ Name="SuppliersVO"
+ Cardinality="1"
+ Source="true"
+ Owner="uimodel.view.SuppliersVO">
+ <DesignTime>
+ <Attr Name="_finderName" Value="SuppliersVO"/>
+ <Attr Name="_isUpdateable" Value="true"/>
+ <Attr Name="_minCardinality" Value="1"/>
+ </DesignTime>
+ <AttrArray Name="Attributes">
+ <Item Value="uimodel.view.SuppliersVO.SupId"/>
+ </AttrArray>
+ </ViewLinkDefEnd>
+ <ViewLinkDefEnd
+ Name="CoffeesVO"
+ Cardinality="-1"
+ Owner="uimodel.view.CoffeesVO">
+ <DesignTime>
+ <Attr Name="_finderName" Value="CoffeesVO"/>
+ <Attr Name="_isUpdateable" Value="true"/>
+ </DesignTime>
+ <AttrArray Name="Attributes">
+ <Item Value="uimodel.view.CoffeesVO.SupId"/>
+ </AttrArray>
+ </ViewLinkDefEnd>
+ <ResourceBundle>
+ <PropertiesBundle
+ PropertiesFile="model.ModelBundle"/>
+ </ResourceBundle>
+</ViewLink>