Mapping tool needs to recognize the use of tablespaces for DB2 on z/OS
----------------------------------------------------------------------
Key: OPENJPA-1925
URL: https://issues.apache.org/jira/browse/OPENJPA-1925
Project: OpenJPA
Issue Type: Improvement
Components: tooling
Affects Versions: 2.0.1, 1.2.2, 1.1.0, 1.0.4, 1.0.5, 1.1.1, 1.2.3, 1.3.0,
2.0.2, 2.1.0, 2.2.0
Environment: DB2 on z/OS
Reporter: Kevin Sutter
The problem is by default OpenJPA tries to create tables in the default system
database. Most DB2 on z/OS users do not have authority to do this and need
their own database and possibly table space to store the data. I had to
manually generate the DDL to create the tables using the mapping tool then edit
it before running the SQL. For example following is part of the default DDL
that was generated.
CREATE TABLE SchemaToUse.Ask (id BIGINT NOT NULL, price DOUBLE, volume INTEGER,
version INTEGER, STOCK_SYMBOL VARCHAR(254), TRADE_ID BIGINT, SELLER_NAME
VARCHAR(254), PRIMARY KEY (id));
And following is the create table statement I had to use to create the table on
z/OS.
CREATE TABLE SchemaToUse.Ask (id BIGINT NOT NULL, price DOUBLE, volume INTEGER,
version INTEGER, STOCK_SYMBOL VARCHAR(254), TRADE_ID BIGINT, SELLER_NAME
VARCHAR(254), PRIMARY KEY (id)) in databaseName.tablespaceName;
A default index was not created on the primary key so I also had to execute
CREATE UNIQUE INDEX schemaToUse.idx1 ON schemaToUse.Ask (ID ASC);
Also, I could not get the mapping Ant task to work after reading the
documentation so had to create a batch file with hard coded paths to run the
mapping tool. Adding a schema export target to OpenJPA samples could be a
useful addition.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.