Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Incorrect schema name during schema generation
Incorrect schema name during schema generation [message #1729025] Sat, 09 April 2016 17:29
Phil Adams is currently offline Phil AdamsFriend
Messages: 1
Registered: April 2016
Junior Member
I'm using eclipselink 2.6.1 packaged with WebSphere Liberty. I have a persistence unit with two entities defined, and each of the entity bean classes specify one or more @Index annotations as part of the @Table annotation. Example:
@Table(name = "RESOURCE", indexes = { @Index(name = "LOGICAL_ID_INDEX", columnList = "LOGICAL_ID", unique = false), ... } )

I also use @GeneratedValue(strategy = GenerationType.TABLE) on the primary key fields of each entity.

I have EL configured to create the tables if needed:
from persistence.xml:
<property name="javax.persistence.schema-generation.database.action" value="create"/>
<property name="javax.persistence.schema-generation.create-database-schemas" value="true"/>

The ddl-generation step works fine as long as I don't attempt to set the default schema name (i.e. table qualifier). But if I register a SessionCustomizer callback and use it to set the table qualifier, then the ddl-generation step fails. It appears that the SEQUENCE table and INDEX creation is oblivious to any table qualifier that I've set. I see the same behavior whether I'm using Derby or DB2 as the underlying db. Here are the DDL statements executed by EL:
CREATE TABLE FHIR1.RESOURCE (ID INTEGER NOT NULL, DATA BLOB(2147483647), LAST_UPDATED TIMESTAMP NOT NULL, LOGICAL_ID VARCHAR(255) NOT NULL, RESOURCE_TYPE VARCHAR(255) NOT NULL, VERSION_ID INTEGER NOT NULL, PRIMARY KEY (ID))
CREATE INDEX LOGICAL_ID_INDEX ON RESOURCE (LOGICAL_ID)
CREATE INDEX VERSION_ID_INDEX ON RESOURCE (VERSION_ID)
CREATE INDEX RESOURCE_TYPE_INDEX ON RESOURCE (RESOURCE_TYPE)
CREATE INDEX LAST_UPDATED_INDEX ON RESOURCE (LAST_UPDATED)
CREATE TABLE FHIR1.PARAMETER (ID INTEGER NOT NULL, NAME VARCHAR(255) NOT NULL, VALUE_CODE VARCHAR(255), VALUE_DATE TIMESTAMP, VALUE_NUMBER FLOAT, VALUE_STRING VARCHAR(255), VALUE_SYSTEM VARCHAR(255), RESOURCE_ID INTEGER NOT NULL, PRIMARY KEY (ID))
CREATE INDEX NAME_INDEX ON PARAMETER (NAME)
CREATE INDEX VALUE_STRING_INDEX ON PARAMETER (VALUE_STRING)
CREATE INDEX VALUE_DATE_INDEX ON PARAMETER (VALUE_DATE)
CREATE INDEX VALUE_NUMBER_INDEX ON PARAMETER (VALUE_NUMBER)
CREATE INDEX VALUE_SYSTEM_INDEX ON PARAMETER (VALUE_SYSTEM)
CREATE INDEX VALUE_CODE_INDEX ON PARAMETER (VALUE_CODE)
ALTER TABLE FHIR1.PARAMETER ADD CONSTRAINT PRAMETERRESOURCEID FOREIGN KEY (RESOURCE_ID) REFERENCES FHIR1.RESOURCE (ID)
CREATE TABLE SEQUENCE (SEQ_NAME VARCHAR(50) NOT NULL, SEQ_COUNT DECIMAL(15), PRIMARY KEY (SEQ_NAME))
INSERT INTO SEQUENCE(SEQ_NAME, SEQ_COUNT) values ('SEQ_GEN_TABLE', 0)
CREATE TABLE SEQUENCE (SEQ_NAME VARCHAR(50) NOT NULL, SEQ_COUNT DECIMAL(15), PRIMARY KEY (SEQ_NAME))
INSERT INTO SEQUENCE(SEQ_NAME, SEQ_COUNT) values ('SEQ_GEN_TABLE', 0)


Could I be missing some sort of secret sauce required to get an alternate schema to work?
Previous Topic:(eclipse helios,mandriva) Schema "dbo" cannot be resolved for table "t_address"
Next Topic:Problems loading attributes from attributes of abstract type
Goto Forum:
  


Current Time: Wed Apr 01 19:02:44 GMT 2020

Powered by FUDForum. Page generated in 0.05105 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top