• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Renaming Entity Bean in WASD

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have used:
Generate --> EJB to RDB Mapping and selected Bottom Up
to automatically generate my entity beans from my database.

Is there anyway that I can now rename these entity beans as they are all named after the database tables that they connect to. This is fine except that the tables have a different naming convention to that used in Java.

I have tried refactoring the individual classes but it doesn't seem to update the deployment descriptor

Thanks in advance,
Adrian
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Adrian,
Welcome to JavaRanch!

In WSAD, there is a J2EE perspective. In there, open the EJB (under EJB modules) and rename it there.
 
Adrian Bates
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jeanne

Thanks for the reply. Can I just qualify exactly what it is that I'm supposed to rename?

I went into the J2EE perspective and the J2EE Hierarchy view and opened the EJB Module / EJB Project / Entity bean folder. If I right click the entity bean I wish to rename I do not get a rename option in the context sensitive menu.

However if I right click the actual class files that make up the entity bean then I can select refactor --> rename. Is this what I am meant to be doing? I have tried this and it produces all sorts of problems. Is there a specific order that I need to do things in?

Thanks again,
Adrian

p.s. I am using Websphere Studio 1.5.2, I wonder if this is why I don't have a rename option. Does that come with Websphere 6.0
 
Jeanne Boyarsky
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Adrian,

I went into the J2EE perspective and the J2EE Hierarchy view and opened the EJB Module / EJB Project / Entity bean folder. If I right click the entity bean I wish to rename I do not get a rename option in the context sensitive menu.


I definitely meant this. I'll check tomorrow in by WSAD to see if I have the option there or somewhere else.

However if I right click the actual class files that make up the entity bean then I can select refactor --> rename. Is this what I am meant to be doing? I have tried this and it produces all sorts of problems. Is there a specific order that I need to do things in?


No. This is just like changing the name the way you were the first time.

p.s. I am using Websphere Studio 1.5.2, I wonder if this is why I don't have a rename option. Does that come with Websphere 6.0


I'm also using WSAD 5.1.X, so that's not the problem.
 
Jeanne Boyarsky
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Adrian,
You're right; it's not an option. I think you have to rename the classes the way you were doing. Another thing is to go into the source of the EJB xml file. There you can change the display name for the EJB as displayed in the J2EE perspective.
 
Adrian Bates
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for looking Jeanne. I have been away for a week which is why I have got back to you.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic