openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Bauer <techhu...@gmail.com>
Subject Re: svn commit: r815473 - in /openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence: embed/attrOverrides/ enhance/identity/
Date Wed, 16 Sep 2009 14:22:03 GMT
Good call.  I dug deeper and found that that the column name is modified to
make it unique but the type mapping ends up getting hosed up somewhere along
the way.  I'll open a JIRA to work on that issue.

-Jeremy

On Tue, Sep 15, 2009 at 3:48 PM, Donald Woods <dwoods@apache.org> wrote:

> If these are reserved words, shouldn't we add them to the OracleDictionary
> so they'll get escaped out for any app that happens to try using them?
>
>
> -Donald
>
>
> jrbauer@apache.org wrote:
>
>> Author: jrbauer
>> Date: Tue Sep 15 20:38:07 2009
>> New Revision: 815473
>>
>> URL: http://svn.apache.org/viewvc?rev=815473&view=rev
>> Log:
>> Modify entity definitions to avoid Oracle reserved words.
>>
>> Modified:
>>
>>  openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/attrOverrides/PhoneNumber.java
>>
>>  openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/attrOverrides/TestAssocOverrides.java
>>
>>  openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/enhance/identity/Employee.java
>>
>>  openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/enhance/identity/PhoneNumber.java
>>
>>  openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/enhance/identity/TestMappedById.java
>>
>> Modified:
>> openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/attrOverrides/PhoneNumber.java
>> URL:
>> http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/attrOverrides/PhoneNumber.java?rev=815473&r1=815472&r2=815473&view=diff
>>
>> ==============================================================================
>> ---
>> openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/attrOverrides/PhoneNumber.java
>> (original)
>> +++
>> openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/attrOverrides/PhoneNumber.java
>> Tue Sep 15 20:38:07 2009
>> @@ -25,17 +25,18 @@
>>  @Table(name="PHONE_ATTROVER")
>>  public class PhoneNumber {
>>     @Id -    int number;
>> +    int phNumber;
>> +             @ManyToMany(mappedBy="contactInfo.phoneNumbers")
>>     Collection<Employee> employees = new ArrayList<Employee>();
>>     -    public int getNumber() {
>> -        return number;
>> +    public int getPhNumber() {
>> +        return phNumber;
>>     }
>>     -    public void setNumber(int number) {
>> -        this.number = number;
>> +    public void setPhNumber(int number) {
>> +        this.phNumber = number;
>>     }
>>         public Collection<Employee> getEmployees() {
>>
>> Modified:
>> openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/attrOverrides/TestAssocOverrides.java
>> URL:
>> http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/attrOverrides/TestAssocOverrides.java?rev=815473&r1=815472&r2=815473&view=diff
>>
>> ==============================================================================
>> ---
>> openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/attrOverrides/TestAssocOverrides.java
>> (original)
>> +++
>> openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/attrOverrides/TestAssocOverrides.java
>> Tue Sep 15 20:38:07 2009
>> @@ -145,7 +145,7 @@
>>
>>     public PhoneNumber createPhoneNumber(EntityManager em) {
>>        PhoneNumber p = new PhoneNumber();
>> -       p.setNumber(phoneId++);
>> +       p.setPhNumber(phoneId++);
>>        em.persist(p);
>>        return p;
>>     }    @@ -187,7 +187,7 @@
>>     }
>>
>>     public void assertPhoneNumber(PhoneNumber p, int empId) {
>> -        int number = p.getNumber();
>> +        int number = p.getPhNumber();
>>         Collection<Employee> es = p.getEmployees();
>>         for (Employee e: es) {
>>             assertEquals(empId, e.getEmpId());
>>
>> Modified:
>> openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/enhance/identity/Employee.java
>> URL:
>> http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/enhance/identity/Employee.java?rev=815473&r1=815472&r2=815473&view=diff
>>
>> ==============================================================================
>> ---
>> openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/enhance/identity/Employee.java
>> (original)
>> +++
>> openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/enhance/identity/Employee.java
>> Tue Sep 15 20:38:07 2009
>> @@ -62,7 +62,7 @@
>>     public boolean equals(Object o) {
>>         Employee e = (Employee) o;
>>         PhoneNumber p = e.getPhoneNumber();
>> -        if (p.getNumber() != phoneNumber.getNumber())
>> +        if (p.getPhNumber() != phoneNumber.getPhNumber())
>>             return false;
>>                 return true;
>>
>> Modified:
>> openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/enhance/identity/PhoneNumber.java
>> URL:
>> http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/enhance/identity/PhoneNumber.java?rev=815473&r1=815472&r2=815473&view=diff
>>
>> ==============================================================================
>> ---
>> openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/enhance/identity/PhoneNumber.java
>> (original)
>> +++
>> openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/enhance/identity/PhoneNumber.java
>> Tue Sep 15 20:38:07 2009
>> @@ -24,18 +24,18 @@
>>  @Table(name="PH_MBI")
>>  public class PhoneNumber {
>>     @Id
>> -    int number;
>> +    int phNumber;
>>         @OneToOne(fetch=FetchType.LAZY)
>>     Employee emp;
>>         -    public int getNumber() {
>> -        return number;
>> +    public int getPhNumber() {
>> +        return phNumber;
>>     }
>>  -    public void setNumber(int number) {
>> -        this.number = number;
>> +    public void setPhNumber(int number) {
>> +        this.phNumber = number;
>>     }
>>         public Employee getEmp() {
>>
>> Modified:
>> openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/enhance/identity/TestMappedById.java
>> URL:
>> http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/enhance/identity/TestMappedById.java?rev=815473&r1=815472&r2=815473&view=diff
>>
>> ==============================================================================
>> ---
>> openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/enhance/identity/TestMappedById.java
>> (original)
>> +++
>> openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/enhance/identity/TestMappedById.java
>> Tue Sep 15 20:38:07 2009
>> @@ -170,7 +170,7 @@
>>         e.setEmpId(1);
>>         e.setEmpType(Employee.EmpType.A1);
>>         PhoneNumber phoneNumber = new PhoneNumber();
>> -        phoneNumber.setNumber(1);
>> +        phoneNumber.setPhNumber(1);
>>         phoneNumber.setEmp(e);
>>         e.setPhoneNumber(phoneNumber);
>>         em.persist(phoneNumber);
>>
>>
>>
>>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message