Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

create-tables-at-deploy persistent.xml not working!

Hello,

When I specify the tag create-tables-at-deploy in persistent.xml, it does nothing! So far I can only get my application to work if I have deployed the tables through NWDS java dictionary project first. Has anyone else seen this setting actually work? It is in the DTD, and it also occurs in the j2ee deploy checklist. In the checklist it says you must make sure the tables exist OR specify create-tables-at-deploy and the app server will create the tables at deploy time per the specification in persistent.xml.

Help! I am actually writing my own sap xdoclet extension which creates the persistent.xml and ejb-j2ee-engine.xml files so that I am not tied at all to NWDS. I'd like to remove this one last dependency on the "java dictionary" project and just use this tag!

Thanks, Chris Hesse

simple example persistent.xml

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE persistent-ejb-map SYSTEM "persistent.dtd">

<persistent-ejb-map>

<create-tables-at-deploy/>

<locking type="Table"/>

<db-properties>

<data-source-name>SAPJ2EDB</data-source-name>

</db-properties>

<entity-beans>

<!--

To add beans that you have deployment descriptor info for, add

a file to your XDoclet merge directory called persistence-beans.xml

that contains the <entity-bean></entity-bean> markup for those beans.

-->

<entity-bean>

<ejb-name>Employee</ejb-name>

<table-name>ERD_EMPLOYEE</table-name>

<field-map

key-type="PrimaryKey">

<field-name>globalId</field-name>

<column>

<column-name>GLOBAL_ID</column-name>

</column>

</field-map>

<field-map

key-type="NoKey">

<field-name>firstName</field-name>

<column>

<column-name>FIRST_NAME</column-name>

</column>

</field-map>

<field-map

key-type="NoKey">

<field-name>lastName</field-name>

<column>

<column-name>LAST_NAME</column-name>

</column>

</field-map>

</entity-bean>

</entity-beans>

</persistent-ejb-map>

Former Member
Not what you were looking for? View more on this topic or Ask a question