HYPERJAXB - DTYPE column length increase and table_name formed very length

344 Views Asked by At

I am using HYPERJAXB-3 -customized-toplink and facing following two problems. Please provide your suggestions to solve.

my XML elements : Eg: GeneralPref.CustomPref.Tradepref

1) TABLE/constraints names are generated with very lengthy name(oracle support 30 chars only) due to my XML element and its sub element having lengthy name Eg: CREATE TABLE DOCUMENTMANAGEMENT_TRADESERVICEUTILITYSETUP ()

How can we change the table name formaton ?

2) Auto Table column 'DTYPE' maximum size is 31 as per http://java.sun.com/xml/ns/persistence/orm xsd. I have received below Error message while executing job. 3) How can i change that 'DTYPE' column size through persisence.properties or some other configutaion

Internal Exception: java.sql.SQLException: ORA-12899: value too large for column "TEST"."DMTRADINGPARTNERSETUP"."DTYPE" (actual: 40, maximum: 31)

Please do the needful.

2

There are 2 best solutions below

0
On

I met the same problems.

For your first questions, I think you can add a customizing bingding.xjb file which customize your column name less then 30 length.

eg. add

<xmlns:hj="http://hyperjaxb3.jvnet.org/ejb/schemas/customizations" xmlns:orm="http://java.sun.com/xml/ns/persistence/orm" jaxb:extensionBindingPrefixes="hj orm">

in global bindings

<jaxb:bindings node="xs:complexType[@name='xxxx']//xs:element[@name='xxx']">

`<hj:basic>`

    `<orm:column name="xxxx" length="1000"/>`
`</hj:basic>`

</jaxb:bindings>

However, for your second question, I haven't figured it out, since I don't know where to customized DTYPE,since DTYPE is generated by hyperjaxb rather than original XSD itself.

0
On

To increase the length of DTYPE, you can also customize it in bindings.xjb

eg.

jaxb:bindings node="xs:complexType[@name='xxxx']">

<hj:entity>
    <orm:discriminator-column length="127"/>
</hj:entity>

/jaxb:bindings>

note: hj:entity> should be included in a xsd complextype ,not element.

Sorry, I don't know what's the problem that when I add '<' + 'j', the word will be invisible.