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

Legacy tables #1

Closed
uris77 opened this issue Apr 25, 2013 · 5 comments
Closed

Legacy tables #1

uris77 opened this issue Apr 25, 2013 · 5 comments
Assignees

Comments

@uris77
Copy link

uris77 commented Apr 25, 2013

Hi, is there any way to stormify an object but not create a new table? Would be helpful with legacy databases.

@kdabir
Copy link
Owner

kdabir commented Apr 25, 2013

By default Gstorm executes "CREATE TABLE IF NOT EXISTS" statement, so if table already exists, then it shouldn't be overwritten. Although, this would mean there has to be an id column in the table which auto-increments itself.

@uris77
Copy link
Author

uris77 commented Apr 25, 2013

Oh, nice.

One more question. I've worked with some old databases that use abbreviations for table names. Is there a way to specify the name of the table?. E.g.

class Person {String name, project}
def g = GStorm(sql)
g.stormify(Person, 'PRS_TBL')

@uris77
Copy link
Author

uris77 commented Apr 25, 2013

Nevermind. I just went through the code and noticed it doesn't support it.

@kdabir
Copy link
Owner

kdabir commented Apr 25, 2013

Thanks for taking a look at the source and raising the first issue as well :) . Currently the implementation is very minimalistic. I am keeping this issue open to add capability to specify table name.

@kdabir
Copy link
Owner

kdabir commented Apr 29, 2013

9c977db (v0.4) Adds support for specifying the custom table name, here is the example.

@Table("people")
class Person { String name, project } 

@kdabir kdabir closed this as completed Apr 29, 2013
@ghost ghost assigned kdabir Jul 25, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants