[jboss-jira] [JBoss JIRA] Updated: (EJBTHREE-916) SQLGrammarException when Using Oracle and Map Collection

Viktor Rees (JIRA) jira-events at lists.jboss.org
Mon Mar 19 08:27:38 EDT 2007


     [ http://jira.jboss.com/jira/browse/EJBTHREE-916?page=all ]

Viktor Rees updated EJBTHREE-916:
---------------------------------

    Description: 
When using a Mapping like this with Oracle:

    @ManyToMany (cascade = CascadeType.ALL)
    @JoinTable(name = "T_TABLE_COLUMN", 
        joinColumns = { @JoinColumn(name = "tableName") }, 
        inverseJoinColumns = { @JoinColumn(name = "columnName") })
    @MapKey(name = "columnName")
    private Map<String,ColumnDef> columns;

Following SQLStatement produces an Oracle Error: ORA-00907: Rechte Klammer fehlt
"  ... select a1.columnName from ColumnDef as a1  ... "
The problem is is the 'as' keywort in the generated query. Oracle does not allow 'as'  for alias table names.

Deploying of the ear works fine. The problem occurs, when trying to access the object. If List instead of Map collection mapping is used all works fine.

There is a simple source code example and ear distributable attached in order to reproduce the bug. 




  was:
When using a Mapping like this with Oracle:

    @ManyToMany (cascade = CascadeType.ALL)
    @JoinTable(name = "T_TABLE_COLUMN", 
        joinColumns = { @JoinColumn(name = "tableName") }, 
        inverseJoinColumns = { @JoinColumn(name = "columnName") })
    @MapKey(name = "columnName")
    private Map<String,ColumnDef> columns;

Following SQLStatement produces an Oracle Error: ORA-00907: Rechte Klammer fehlt
"  ... select a1.columnName from ColumnDef as a1  ... "
The problem is is the 'as' keywort in the generated query. Oracle does not allow 'as'  for alias table names.

Deploying of the ear works fine. The problem occurs, when trying to access the object. If List instead of Map collection mapping is used all works fine.

There is a simple source code exmple and ear distributable in order to reproduce the bug. How can I attach or upload?




> SQLGrammarException when Using Oracle and Map Collection
> --------------------------------------------------------
>
>                 Key: EJBTHREE-916
>                 URL: http://jira.jboss.com/jira/browse/EJBTHREE-916
>             Project: EJB 3.0
>          Issue Type: Bug
>    Affects Versions: EJB 3.0 RC9 - FD
>         Environment: Oracle 9.2, Suse 9.1, JBoss 4.0.5, EJB3.0 RC9 (Error also occurs in RC7)
>            Reporter: Viktor Rees
>         Attachments: EJBTHREE_916.zip
>
>   Original Estimate: 2 hours
>  Remaining Estimate: 2 hours
>
> When using a Mapping like this with Oracle:
>     @ManyToMany (cascade = CascadeType.ALL)
>     @JoinTable(name = "T_TABLE_COLUMN", 
>         joinColumns = { @JoinColumn(name = "tableName") }, 
>         inverseJoinColumns = { @JoinColumn(name = "columnName") })
>     @MapKey(name = "columnName")
>     private Map<String,ColumnDef> columns;
> Following SQLStatement produces an Oracle Error: ORA-00907: Rechte Klammer fehlt
> "  ... select a1.columnName from ColumnDef as a1  ... "
> The problem is is the 'as' keywort in the generated query. Oracle does not allow 'as'  for alias table names.
> Deploying of the ear works fine. The problem occurs, when trying to access the object. If List instead of Map collection mapping is used all works fine.
> There is a simple source code example and ear distributable attached in order to reproduce the bug. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list