Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Kozzi11 opened this issue Jan 29, 2013 · 7 comments
Open

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

Kozzi11 opened this issue Jan 29, 2013 · 7 comments

Comments

@Kozzi11
Copy link
Contributor

Kozzi11 commented Jan 29, 2013

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

BatooJPA use in MySQL query "TableName" instead of TableName

@hceylan
Copy link
Member

hceylan commented Jan 29, 2013

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

@Kozzi11
Copy link
Contributor Author

Kozzi11 commented Jan 29, 2013

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
Copy link
Contributor Author

Kozzi11 commented Jan 29, 2013

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

@hceylan
Copy link
Member

hceylan commented Jan 29, 2013

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
Copy link
Contributor Author

Kozzi11 commented Jan 29, 2013

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
Copy link
Member

hceylan commented Jan 29, 2013

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
Copy link

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants