Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » EclipseLink JPA2.0 orm table name prefix help(Choose a table name prefix with eclipselink an jpa 2.0)
EclipseLink JPA2.0 orm table name prefix help [message #630158] Thu, 30 September 2010 16:03 Go to next message
miguel is currently offline miguel
Messages: 4
Registered: September 2010
Junior Member
Hi,

I need to choose a name prefix for my data base tables, with JPA2 and eclipselink.

For this i try to do:

add:
<mapping-file>META-INF/orm.xml</mapping-file> to my persistence.xml

and create: orm.xml in the configuration folder with the code:

<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings version="2.0"
xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<property name="SQL_TABLE_NAME_PREFIX" value="TBL_"></property>
</entity-mappings>

but nothing ocurrs, what is the way for this?

thankss

thanks.

[Updated on: Thu, 30 September 2010 16:03]

Report message to a moderator

Re: EclipseLink JPA2.0 orm table name prefix help [message #630308 is a reply to message #630158] Fri, 01 October 2010 10:19 Go to previous message
Chris Delahunt is currently offline Chris Delahunt
Messages: 995
Registered: July 2009
Senior Member
Hello,

Looks like SQL_TABLE_NAME_PREFIX is a teneo property, or atleast a static string in the org.eclipse.emf.teneo.PersistenceOptions class, not a JPA/Eclipselink property. The Teneo property it refers to is "teneo.mapping.sql_table_name_prefix", and there is no JPA or EclipseLink equivalent. The only way to add a prefix to tables in JPA is to define each table with the prefix. In EclipseLink, you can use a customizer to accesses and modify the tables, but requires advanced native api and internal digging to get at each individual table.

Please file an enhancement to have such a feature implemented in EclipseLink.

Best Regards,
Chris

[Updated on: Fri, 01 October 2010 10:20]

Report message to a moderator

Previous Topic:Getting Results and Count from NamedQuery
Next Topic:add column in a table
Goto Forum:
  


Current Time: Mon Apr 21 03:22:03 EDT 2014

Powered by FUDForum. Page generated in 0.04193 seconds