Search in sources :

Example 21 with PLSQLrecord

use of org.eclipse.persistence.platform.database.oracle.plsql.PLSQLrecord in project eclipselink by eclipse-ee4j.

the class PLSQLProject method buildMissingTypeAddressListOutQuery.

protected DatabaseQuery buildMissingTypeAddressListOutQuery() {
    PLSQLrecord record = buildAddressRecord();
    PLSQLCollection collection = new PLSQLCollection();
    collection.setTypeName("PLSQL_P.PLSQL_ADDRESS_LIST");
    collection.setNestedType(record);
    PLSQLStoredProcedureCall call = new PLSQLStoredProcedureCall();
    call.setProcedureName("PLSQL_P.PLSQL_ADDRESS_LIST_OUT");
    call.addNamedOutputArgument("P_ADDRESS_LIST", collection);
    call.addNamedOutputArgument("P_CITY", JDBCTypes.VARCHAR_TYPE);
    DataReadQuery query = new DataReadQuery();
    query.setCall(call);
    return query;
}
Also used : PLSQLStoredProcedureCall(org.eclipse.persistence.platform.database.oracle.plsql.PLSQLStoredProcedureCall) PLSQLCollection(org.eclipse.persistence.platform.database.oracle.plsql.PLSQLCollection) PLSQLrecord(org.eclipse.persistence.platform.database.oracle.plsql.PLSQLrecord) DataReadQuery(org.eclipse.persistence.queries.DataReadQuery)

Example 22 with PLSQLrecord

use of org.eclipse.persistence.platform.database.oracle.plsql.PLSQLrecord in project eclipselink by eclipse-ee4j.

the class PLSQLProject method buildBadAddressOutObjectQuery.

protected DatabaseQuery buildBadAddressOutObjectQuery() {
    PLSQLrecord record = buildAddressRowTypeRecord();
    record.setTypeName(null);
    PLSQLStoredProcedureCall call = new PLSQLStoredProcedureCall();
    call.setProcedureName("PLSQL_ADDRESS_INOUT");
    call.addNamedOutputArgument("P_ADDRESS", record);
    DataReadQuery query = new DataReadQuery();
    query.setCall(call);
    return query;
}
Also used : PLSQLStoredProcedureCall(org.eclipse.persistence.platform.database.oracle.plsql.PLSQLStoredProcedureCall) PLSQLrecord(org.eclipse.persistence.platform.database.oracle.plsql.PLSQLrecord) DataReadQuery(org.eclipse.persistence.queries.DataReadQuery)

Example 23 with PLSQLrecord

use of org.eclipse.persistence.platform.database.oracle.plsql.PLSQLrecord in project eclipselink by eclipse-ee4j.

the class PLSQLProject method buildAddressRowTypeDataRecord.

protected PLSQLrecord buildAddressRowTypeDataRecord() {
    PLSQLrecord record = new PLSQLrecord();
    record.setTypeName("PLSQL_ADDRESS%ROWTYPE");
    record.addField("ADDRESS_ID", JDBCTypes.NUMERIC_TYPE, 10, 0);
    record.addField("STREET_NUM", JDBCTypes.NUMERIC_TYPE, 10, 0);
    record.addField("STREET", JDBCTypes.VARCHAR_TYPE, 30);
    record.addField("CITY", JDBCTypes.VARCHAR_TYPE, 30);
    record.addField("STATE", JDBCTypes.VARCHAR_TYPE, 30);
    return record;
}
Also used : PLSQLrecord(org.eclipse.persistence.platform.database.oracle.plsql.PLSQLrecord)

Example 24 with PLSQLrecord

use of org.eclipse.persistence.platform.database.oracle.plsql.PLSQLrecord in project eclipselink by eclipse-ee4j.

the class PLSQLProject method buildAddressInOutObjectQuery.

protected DatabaseQuery buildAddressInOutObjectQuery() {
    PLSQLrecord record = buildAddressRowTypeRecord();
    PLSQLStoredProcedureCall call = new PLSQLStoredProcedureCall();
    call.setProcedureName("PLSQL_ADDRESS_INOUT");
    call.addNamedInOutputArgument("P_ADDRESS", record);
    DataReadQuery query = new DataReadQuery();
    query.addArgument("P_ADDRESS", Address.class);
    query.setCall(call);
    return query;
}
Also used : PLSQLStoredProcedureCall(org.eclipse.persistence.platform.database.oracle.plsql.PLSQLStoredProcedureCall) PLSQLrecord(org.eclipse.persistence.platform.database.oracle.plsql.PLSQLrecord) DataReadQuery(org.eclipse.persistence.queries.DataReadQuery)

Example 25 with PLSQLrecord

use of org.eclipse.persistence.platform.database.oracle.plsql.PLSQLrecord in project eclipselink by eclipse-ee4j.

the class PLSQLProject method buildPhoneRecord.

protected PLSQLrecord buildPhoneRecord() {
    PLSQLrecord record = new PLSQLrecord();
    record.setTypeName("PLSQL_P.PLSQL_PHONE_REC");
    record.setCompatibleType("PLSQL_P_PLSQL_PHONE_REC");
    record.addField("AREA_CODE", JDBCTypes.VARCHAR_TYPE, 3);
    record.addField("P_NUM", JDBCTypes.VARCHAR_TYPE, 7);
    record.setJavaType(Phone.class);
    return record;
}
Also used : PLSQLrecord(org.eclipse.persistence.platform.database.oracle.plsql.PLSQLrecord)

Aggregations

PLSQLrecord (org.eclipse.persistence.platform.database.oracle.plsql.PLSQLrecord)33 PLSQLStoredProcedureCall (org.eclipse.persistence.platform.database.oracle.plsql.PLSQLStoredProcedureCall)24 DataReadQuery (org.eclipse.persistence.queries.DataReadQuery)14 PLSQLCollection (org.eclipse.persistence.platform.database.oracle.plsql.PLSQLCollection)10 DataModifyQuery (org.eclipse.persistence.queries.DataModifyQuery)8 StringReader (java.io.StringReader)6 ObjectPersistenceWorkbenchXMLProject (org.eclipse.persistence.internal.sessions.factories.ObjectPersistenceWorkbenchXMLProject)6 XMLContext (org.eclipse.persistence.oxm.XMLContext)6 XMLMarshaller (org.eclipse.persistence.oxm.XMLMarshaller)6 Project (org.eclipse.persistence.sessions.Project)6 PLSQLrecordTestHelper.buildTestProject (org.eclipse.persistence.testing.tests.plsqlrecord.PLSQLrecordTestHelper.buildTestProject)6 PLSQLrecordTestHelper.buildWorkbenchXMLProject (org.eclipse.persistence.testing.tests.plsqlrecord.PLSQLrecordTestHelper.buildWorkbenchXMLProject)6 Test (org.junit.Test)6 Document (org.w3c.dom.Document)6 ReadObjectQuery (org.eclipse.persistence.queries.ReadObjectQuery)3 ComplexDatabaseType (org.eclipse.persistence.internal.helper.ComplexDatabaseType)2 OracleObjectType (org.eclipse.persistence.platform.database.oracle.jdbc.OracleObjectType)2 PLSQLStoredFunctionCall (org.eclipse.persistence.platform.database.oracle.plsql.PLSQLStoredFunctionCall)2 PLSQLargument (org.eclipse.persistence.platform.database.oracle.plsql.PLSQLargument)2 CompositeDatabaseType (org.eclipse.persistence.tools.oracleddl.metadata.CompositeDatabaseType)2