use of org.eclipse.persistence.tools.oracleddl.util.DatabaseTypeBuilder in project eclipselink by eclipse-ee4j.
the class ProcedureTypeTestSuite method setUp.
@BeforeClass
public static void setUp() throws ClassNotFoundException, SQLException {
AllTests.setUp();
String ddlCreateProp = System.getProperty(DATABASE_DDL_CREATE_KEY, DEFAULT_DATABASE_DDL_CREATE);
if ("true".equalsIgnoreCase(ddlCreateProp)) {
ddlCreate = true;
}
String ddlDropProp = System.getProperty(DATABASE_DDL_DROP_KEY, DEFAULT_DATABASE_DDL_DROP);
if ("true".equalsIgnoreCase(ddlDropProp)) {
ddlDrop = true;
}
String ddlDebugProp = System.getProperty(DATABASE_DDL_DEBUG_KEY, DEFAULT_DATABASE_DDL_DEBUG);
if ("true".equalsIgnoreCase(ddlDebugProp)) {
ddlDebug = true;
}
if (ddlCreate) {
runDdl(conn, CREATE_OUT_IN_INOUT_ARGSSP_PROC, ddlDebug);
}
// use DatabaseTypeBuilder to generate a list of ProcedureTypes
dbTypeBuilder = new DatabaseTypeBuilder();
try {
dbProcedures = dbTypeBuilder.buildProcedures(conn, "TOPLEVEL", "OUTININOUTARGSSP");
} catch (ParseException e) {
e.printStackTrace();
}
}
use of org.eclipse.persistence.tools.oracleddl.util.DatabaseTypeBuilder in project eclipselink by eclipse-ee4j.
the class VArrayTypeTestSuite method setUp.
@BeforeClass
public static void setUp() throws ClassNotFoundException, SQLException {
AllTests.setUp();
String ddlCreateProp = System.getProperty(DATABASE_DDL_CREATE_KEY, DEFAULT_DATABASE_DDL_CREATE);
if ("true".equalsIgnoreCase(ddlCreateProp)) {
ddlCreate = true;
}
String ddlDropProp = System.getProperty(DATABASE_DDL_DROP_KEY, DEFAULT_DATABASE_DDL_DROP);
if ("true".equalsIgnoreCase(ddlDropProp)) {
ddlDrop = true;
}
String ddlDebugProp = System.getProperty(DATABASE_DDL_DEBUG_KEY, DEFAULT_DATABASE_DDL_DEBUG);
if ("true".equalsIgnoreCase(ddlDebugProp)) {
ddlDebug = true;
}
if (ddlCreate) {
runDdl(conn, CREATE_VCARRAY_VARRAY, ddlDebug);
runDdl(conn, CREATE_GETVCARRAY_PROC, ddlDebug);
}
// use DatabaseTypeBuilder to generate a list of ProcedureTypes
dbTypeBuilder = new DatabaseTypeBuilder();
try {
dbProcedures = dbTypeBuilder.buildProcedures(conn, "TOPLEVEL", "GETVCARRAY");
} catch (ParseException e) {
e.printStackTrace();
}
}
use of org.eclipse.persistence.tools.oracleddl.util.DatabaseTypeBuilder in project eclipselink by eclipse-ee4j.
the class XMLTypeTestSuite method setUp.
@SuppressWarnings({ "rawtypes", "unchecked" })
@BeforeClass
public static void setUp() throws ClassNotFoundException, SQLException {
AllTests.setUp();
String ddlCreateProp = System.getProperty(DATABASE_DDL_CREATE_KEY, DEFAULT_DATABASE_DDL_CREATE);
if ("true".equalsIgnoreCase(ddlCreateProp)) {
ddlCreate = true;
}
String ddlDropProp = System.getProperty(DATABASE_DDL_DROP_KEY, DEFAULT_DATABASE_DDL_DROP);
if ("true".equalsIgnoreCase(ddlDropProp)) {
ddlDrop = true;
}
String ddlDebugProp = System.getProperty(DATABASE_DDL_DEBUG_KEY, DEFAULT_DATABASE_DDL_DEBUG);
if ("true".equalsIgnoreCase(ddlDebugProp)) {
ddlDebug = true;
}
if (ddlCreate) {
runDdl(conn, CREATE_DBWS_XML_WRAPPER_TYPE, ddlDebug);
runDdl(conn, CREATE_XMLTYPETESTPKG_PACKAGE, ddlDebug);
}
String schema = System.getProperty(DATABASE_USERNAME_KEY, DEFAULT_DATABASE_USERNAME);
List<String> procedurePatterns = new ArrayList<String>();
procedurePatterns.add("GET_XMLTYPE");
procedurePatterns.add("RETURN_XMLTYPE");
// use DatabaseTypeBuilder to generate a list of PackageTypes
dbTypeBuilder = new DatabaseTypeBuilder();
dbProcedures = new ArrayList();
try {
// process the package
List<PLSQLPackageType> packages = dbTypeBuilder.buildPackages(conn, schema, "XMLTYPETESTPKG");
for (PLSQLPackageType pkgType : packages) {
// now get the desired procedures/functions from the processed package
for (ProcedureType procType : pkgType.getProcedures()) {
if (procedurePatterns.contains(procType.getProcedureName())) {
dbProcedures.add(procType);
}
}
}
} catch (ParseException e) {
e.printStackTrace();
}
}
Aggregations