Jump to: navigation, search

Difference between revisions of "EclipseLink/UserGuide/JPA/Advanced JPA Development/Schema Generation/Appending strings to CREATE TABLE statements"

(New page: {{EclipseLink_UserGuide |info=y |toc=n |eclipselink=y |eclipselinktype=JPA |api=y |apis=[http://www.eclipse.org/eclipselink/api/latest/eclipse/persistence/annotations/CascadeOnDelete.html ...)
 
Line 12: Line 12:
  
 
>>>>>> THIS PAGE IS IN PROGRESS. PLEASE SEE DISCUSSION PAGE. <<<<<<
 
>>>>>> THIS PAGE IS IN PROGRESS. PLEASE SEE DISCUSSION PAGE. <<<<<<
 +
===Example===
 +
An EclipseLink-orm.xml file with the following tag (assuming it has an id annotated):
 +
<pre><entity class="Comment">
 +
  <table name="DDL_COMMENT" creation-suffix="COMMENT='User Comment Table'"/>
 +
</entity></pre>
 +
 +
will result in the creation statement:
 +
<pre>
 +
  CREATE TABLE DDL_COMMENT (ID INTEGER) COMMENT='User Comment Table'
 +
</pre>
 +
 +
Coupled with persistence property:
 +
 +
<pre><property name="eclipselink.ddl.default-table-suffix" value="engine=InnoDB"/></pre>
 +
 +
will result in the creation statement:
 +
<pre>
 +
  CREATE TABLE DDL_COMMENT (ID INTEGER) COMMENT='User Comment Table' engine=InnoDB
 +
</pre>
  
 
{{EclipseLink_JPA
 
{{EclipseLink_JPA

Revision as of 11:44, 1 February 2011

EclipseLink JPA

link="http://wiki.eclipse.org/EclipseLink"
EclipseLink
Website
Download
Community
Mailing ListForumsIRC
Bugzilla
Open
Help Wanted
Bug Day
Contribute
Browse Source

Elug api package icon.png Key API CascadeOnDelete


Appending Strings to CREATE TABLE Statements

>>>>>> THIS PAGE IS IN PROGRESS. PLEASE SEE DISCUSSION PAGE. <<<<<<

Example

An EclipseLink-orm.xml file with the following tag (assuming it has an id annotated):

<entity class="Comment">
  <table name="DDL_COMMENT" creation-suffix="COMMENT='User Comment Table'"/>
</entity>

will result in the creation statement:

  CREATE TABLE DDL_COMMENT (ID INTEGER) COMMENT='User Comment Table'

Coupled with persistence property:

<property name="eclipselink.ddl.default-table-suffix" value="engine=InnoDB"/>

will result in the creation statement:

  CREATE TABLE DDL_COMMENT (ID INTEGER) COMMENT='User Comment Table' engine=InnoDB

Eclipselink-logo.gif
Version: 2.2.0 DRAFT
Other versions...