-
Mar 8th, 2010, 09:55 PM
#1
rename an entity
What is the easiest way to rename an entity class after it is created in roo?
I tried using eclipse refactor, but it left quite a few things for me to change manually.
Thanks
-
Mar 9th, 2010, 04:20 PM
#2
Refactor > Rename should be OK. The only thing it won't rename is the associated tests and data on demand classes. Roo will pick up the rename and make new ITDs, removing the old ITDs for the old name.
-
Nov 4th, 2010, 03:10 PM
#3
related question: In STS, I've used DBRE to create some entities and one of them, for example, is named Customers (based on the existing table "customers"). When I use the IDE to rename that class Customer, Roo regenerates new .aj files, but leaves out it's DbManaged file, which seems odd. Then, if I stop and restart the Roo shell, it recreates the old Customers structures and completely undoes my change... so I can't seem to control/rename these entities that are based on database reverse engineering. thanks for any help.
-
Nov 4th, 2010, 07:22 PM
#4
Please raise a Jira ticket for this. I can only explain the latter part at the moment, in that, when Roo starts up, it looks at the .roo-dbre file and if the entity does not exist that matches a table name, it will get recreated. I believe now that the class name will need to be added (and maintained) in the <table> element so that new entities will not get created based on the table name if a previous entity has been renamed.
-
Nov 9th, 2010, 06:08 PM
#5
-
Dec 7th, 2010, 04:39 PM
#6
Fixed where?
This is fixed in what release? I'm on 1.1.0.RELEASE [rev 793f2b0] and I'm still seeing this behavior.
-Matt
-
Dec 7th, 2010, 04:56 PM
#7
It is is fixed for the 1.1.1 release. Please download the code friom Git and try.
-
Dec 7th, 2010, 09:15 PM
#8
Excellent!
Alan-
Worked like a charm. Thanks!
-Matt
-
Feb 21st, 2011, 09:18 PM
#9
I have verified this as well. However, I would like to propose that the solution is not ideal. My testing shows that the renamed class is now ignored by DBRE. It is an improvement that DBRE no longer recreates the original class. What I would prefer if for DBRE to treat the new name as an alias. Specifically, I'd like it to still support round trip reverse engineering for the class. E.G. If I add a column to the "customers" table, I'd expect to see it appear in the "Customer" class. Is this asking too much?
Bob
-
Feb 22nd, 2011, 09:41 PM
#10
Please raise an improvement ticket for this.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules