Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Problem with @Table(name = "\"TableName\"") #140

Open
Kozzi11 opened this Issue · 7 comments

3 participants

@Kozzi11

When I use Table annotation:
@Table(name = "\"TableName\"")

BatooJPA use in MySQL query "TableName" instead of TableName

@hceylan
Owner

BatooJPA does not sanitize the name of the table. Why do you put the quotation marks around the name?

@Kozzi11

Because I make some benchmark of different JPA providers, and try to have same source for all of them. And BatooJPA is the only one, which has this issue.

@Kozzi11

However removing quotation marks, seems to work ok, but still I am interesting why others JPA providers works well with quotation marks.

@hceylan
Owner

That is an interesting point. As I said earlier, BatooJPA does NOT sanitize the table names. Obviously others do.

Out of curiosity why do you need the quotes? If there's a use case we certainly may implement a DB specific sanitizing processor.

@Kozzi11

I found out, I really don't need them. First I have only
@Entity
class TableName ...
But with Eclipse(Top)Link I get errors, because it change TableName to TABLENAME, so after searching I find that I can write @Table(name = "\"TableName\""), and with this everything works OK, until I try BatooJPA, but with @Table(name = "TableName") works all JPA providers, which I already try

@hceylan
Owner

OK still do not understand with Eclipselink does not work with TableName. However I'll keep the issue open for further investigation to be inline with other providers.

@xjarkrof

As I understand, the quotation should be replace by JPA provider to the database delimiters for long identifier / case sensitive / reserved word (for example for MSSQL something like [...] or '...').

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.