You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Sudheer Ghanathe (JIRA)" <ji...@apache.org> on 2007/03/22 06:30:32 UTC

[jira] Created: (OPENJPA-178) Handle case-sensitive databases - inappropriate change of field case to uppercase

Handle case-sensitive databases - inappropriate change of field case to uppercase
---------------------------------------------------------------------------------

                 Key: OPENJPA-178
                 URL: https://issues.apache.org/jira/browse/OPENJPA-178
             Project: OpenJPA
          Issue Type: Bug
          Components: jdbc
    Affects Versions: 0.9.6
         Environment: Windows, Microsoft SQL Server 2000 and any other case-sensitive database
            Reporter: Sudheer Ghanathe


@Id()
@GeneratedValue(strategy=GenerationType.TABLE, generator="ReferenceGen")
@TableGenerator(name="ReferenceGen", table="sequencer", pkColumnName="SequencerID",
        valueColumnName="keyid",pkColumnValue="reference",schema="dbo",allocationSize=1)
	@Column(name="referenceID", unique=true, nullable=false, precision=10)
	public Integer getReferenceId() {
		return this.referenceId;
	}
	public void setReferenceId(Integer referenceId) {
		this.referenceId = referenceId;
	}

The select statement generated in the above primary key generation has inappropriate uppercase for SEQUENCERID, it should have been left as SequencerID. This causes the select to fail which in turn causes the generatedvalue to fail.

Resolution:
Change the following method in the class org.apache.openjpa.jdbc.sql.DBDictionary.java  as follows

protected String makeNameValid(String name, NameSet set, int maxLen,
        int nameType) {
.....
.....
		return name;
        //return name.toUpperCase();
    }



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