openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jianfeng Mao (JIRA)" <>
Subject [jira] Created: (OPENJPA-795) enhancer throws an exception when parsing column name "" because it thinks 'first' is a table name
Date Thu, 27 Nov 2008 16:42:44 GMT
enhancer throws an exception when parsing column name "" because it thinks 'first'
is a table name

                 Key: OPENJPA-795
             Project: OpenJPA
          Issue Type: Bug
          Components: jdbc
    Affects Versions: 1.2.0
         Environment: Windows XP, Eclipse 3.4 SR1, OpenJPA-1.2.0,  IBM U2JPA-1.0.0, IBM U2
            Reporter: Jianfeng Mao
            Priority: Critical

IBM U2JPA is a JPA implementation based on OpenJPA for IBM  U2 Databases.  IBM U2 Databases
allow the use of '.' in the column names, such as "FIRST.NAME', "LAST.NAME", "PURCHASE.DATE".
 This causes the enhancer to exception out when parsing these column names, as shown below.
 We have tried, in our implementation,  to change the catalogSeparator to different values
than '.' to prevent the enhancer from breaking the above names into 'tablename'.'columnname'.
But nothing worked.  Later i found the following code in openjpa\jdbc\meta\,
clearly the separator is hardcoded as '.'.  I set the priority of this issue to 'critical'
because this problem has severely impacted the adoption of U2JPA by our customers. 

                 int dotIdx = colName.lastIndexOf('.');
                 if (dotIdx == 0)
                            colName = colName.substring(1);
                 else if (dotIdx != -1) {
                           findTable(context, colName.substring(0, dotIdx), table,
                                null, null);
                           colName = colName.substring(dotIdx + 1);

class U2Dictionary extends DBDictionary {
	private ArrayList<U2DictRecord> u2fields = new ArrayList<U2DictRecord>();

	U2Dictionary() {
		platform = "IBM U2";
		catalogSeparator = ":";

public class Customer implements Serializable {

	private String _id;

	private String name;

	public Customer(){};

	public String get_id() {
		return _id;

	public void set_id(String _id) {
		this._id = _id;

	public String getName() {
		return name;

	public void setName(String name) { = name;


Exception in thread "main" <openjpa-1.2.0-r422266:683325 fatal user error> org.apache.openjpa.persistence.ArgumentException:
When mapping "" to table "CUSTOMER", found a column mapped to
illegal table "FIRST".
	at org.apache.openjpa.jdbc.meta.MappingInfo.findTable(
	at org.apache.openjpa.jdbc.meta.MappingInfo.mergeColumn(
	at org.apache.openjpa.jdbc.meta.MappingInfo.createColumns(
	at org.apache.openjpa.jdbc.meta.ValueMappingInfo.getColumns(
	at org.apache.openjpa.jdbc.meta.FieldMapping.setStrategy(
	at org.apache.openjpa.jdbc.meta.RuntimeStrategyInstaller.installStrategy(
	at org.apache.openjpa.jdbc.meta.FieldMapping.resolveMapping(
	at org.apache.openjpa.jdbc.meta.FieldMapping.resolve(
	at org.apache.openjpa.jdbc.meta.ClassMapping.resolveNonRelationMappings(
	at org.apache.openjpa.jdbc.meta.MappingRepository.prepareMapping(
	at org.apache.openjpa.meta.MetaDataRepository.preMapping(
	at org.apache.openjpa.meta.MetaDataRepository.resolve(
	at org.apache.openjpa.meta.MetaDataRepository.getMetaData(
	at org.apache.openjpa.kernel.BrokerImpl.newObjectId(
	at org.apache.openjpa.kernel.DelegatingBroker.newObjectId(
	at org.apache.openjpa.persistence.EntityManagerImpl.find(
	at u2u.u2jpa.demo1.Demo1Main.main(

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message