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

Customizable table name #31

Closed
gcalaprice opened this Issue May 1, 2015 · 4 comments

Comments

Projects
None yet
2 participants
@gcalaprice

gcalaprice commented May 1, 2015

Hi, as discussed via Twitter, I need to customize the name of a mapped table. For example, if I create a new RushObject child class "Book", the related table has the name of the class to which it refers (Book). This need is determined by design specification of the app. It would be nice if I can customize the table name via an annotation on the class (e.g. @RushTableName("MyCustomTableName") ). Thanks in advance.

@Stuart-campbell

This comment has been minimized.

Show comment
Hide comment
@Stuart-campbell

Stuart-campbell May 2, 2015

Owner

Hi,

There is already an annotation for setting the class serialization name

@RushClassSerializationName

My plan in v1.1.4 is to add an optional manifest metadata tag which would mean the name provided there would also be used as the table name.

Owner

Stuart-campbell commented May 2, 2015

Hi,

There is already an annotation for setting the class serialization name

@RushClassSerializationName

My plan in v1.1.4 is to add an optional manifest metadata tag which would mean the name provided there would also be used as the table name.

@gcalaprice

This comment has been minimized.

Show comment
Hide comment
@gcalaprice

gcalaprice May 4, 2015

Hi,
what is the correct use of this annotation? I tried @RushClassSerializationName(name = "NewLogEvent") because my table should be named "NewLogEvent", but logging the SQL I got this CREATE TABLE rush_<package_name>_<class_name>_BikeLog. The class name refers to the class that extends RushObject.

@RushTableAnnotation
@RushClassSerializationName(name = "NewLogEvent")
public class ClassName extends RushObject {...}

Thanks!

gcalaprice commented May 4, 2015

Hi,
what is the correct use of this annotation? I tried @RushClassSerializationName(name = "NewLogEvent") because my table should be named "NewLogEvent", but logging the SQL I got this CREATE TABLE rush_<package_name>_<class_name>_BikeLog. The class name refers to the class that extends RushObject.

@RushTableAnnotation
@RushClassSerializationName(name = "NewLogEvent")
public class ClassName extends RushObject {...}

Thanks!

@Stuart-campbell

This comment has been minimized.

Show comment
Hide comment
@Stuart-campbell

Stuart-campbell May 4, 2015

Owner

Hi,

Not actually implemented it yet. Thats the idea of how it will work. Hope to do a new release with it in tomorrow.

Thanks

Owner

Stuart-campbell commented May 4, 2015

Hi,

Not actually implemented it yet. Thats the idea of how it will work. Hope to do a new release with it in tomorrow.

Thanks

Stuart-campbell added a commit that referenced this issue May 5, 2015

How to delete/drop/empty whole database #32, Customizable table name #31
, Database migration issue #30, How to clear a table? #27,

 Edit New issue
How to execute SQL? #26
@Stuart-campbell

This comment has been minimized.

Show comment
Hide comment
@Stuart-campbell

Stuart-campbell May 5, 2015

Owner

I have added this in v1.1.4. Changed my mind about using @RushClassSerializationName as you might want that to differ from database name. Not sure why but no point restricting.

Add

@RushCustomTableName(name = "MyCustomName")

to your class.

Thanks

Owner

Stuart-campbell commented May 5, 2015

I have added this in v1.1.4. Changed my mind about using @RushClassSerializationName as you might want that to differ from database name. Not sure why but no point restricting.

Add

@RushCustomTableName(name = "MyCustomName")

to your class.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment