Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Adding entity bean in web sphere 6.1

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working with web sphere 6.1 and backend as DB2 on AS400 machine. EJB version is 1.1
I want to add a new entity bean for a Physical file in DB2 so as to use those entity bean's classes to retrieve data from physical file.

Up to now I have added the new entity bean in ejb-jar.xml file. Added one Finder for it. Then I added the CREATE table entry in Table.ddl file and then did mapping in Map.mapxmi file. This process creates 4 classes for that entity bean added. (e.g. pfnameHome.java, pfnamekey.java, pfnameBean.java and pfname.java)

But I don't know about files ibm-ejb-jar-bnd.xmi and ibm-ejb-jar-ext.xmi.
I found entry for new added bean is being placed in ibm-ejb-jar-bnd.xmi but not in ibm-ejb-jar-ext.xmi.

First I want to know what are these two files for? Is it needed to do entry in these files manually or should web sphere have to handle it?

please reply if any one have any idea about it.
 
author & internet detective
Posts: 40200
816
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nagsen,
Those files are IBM specific extensions. You can set them via the admin console (or presumably jacl/jython scripts)
 
Nagsen Kamble
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jeanne,
Thanks a lot for your reply to my very first query on Javaranch. Actually Javaranch is the first forum I ever tried in my life and I really liked Javaranch. I also gone through your profile and I feel it is very good.

So, as per you suggested, I tried to find the place in Admin console of WAS 6.1 to do settings related to ibm-ejb-jar-bnd.xmi and ibm-ejb-jar-ext.xmi but I couldn't find them anywhere in admin console.
Also I am not familiar with Jython script. So I left that one too.
But it is found that the EJB deployment descriptor editor can be used to set Websphere extensions. This automatically modifies the ibm-ejb-jar-bnd.xmi and ibm-ejb-jar-ext.xmi. So it is almost done now.

Now I got a new one. Please help me Jeanne if you know about it.
In WAS 6.1 for a newly added entity bean four java files are generated.

1.Remote interface for Enterprise Bean
2.Bean implementation class for Enterprise Bean
3.Home interface for Enterprise Bean
4.Key class for Entity Bean

When these files were generated, the bean implementation class for Enterprise Bean did contain CMP fields declaration only but not any getters-setters for them.
Do we need to add getters and setters manually (i.e. Source -> Generate Getters and Setters) in Bean implementation class for Enterprise Bean or should they automatically be added by Websphere application server?

Similarly, in Remote interface for Enterprise Bean do we manually have to declare the getters and setters for CMP fields or can it be automated somehow?

Did I wrong somewhere or this is it what it is?
 
Jeanne Boyarsky
author & internet detective
Posts: 40200
816
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Nagsen Kamble:
EJB deployment descriptor editor can be used to set Websphere extensions.


Right. That's what I meant when I said the admin console. If you drill down on the ear, it takes you there.


When these files were generated, the bean implementation class for Enterprise Bean did contain CMP fields declaration only but not any getters-setters for them.
Do we need to add getters and setters manually (i.e. Source -> Generate Getters and Setters) in Bean implementation class for Enterprise Bean or should they automatically be added by Websphere application server?

Similarly, in Remote interface for Enterprise Bean do we manually have to declare the getters and setters for CMP fields or can it be automated somehow?


Hmm. Trying to remember. (I use an IDE that takes care of these details for me.) I think the bean has abstract getters/setters. Which would mean the interface would need them as well.

One thing though. Do you really have a remote rather than local interface for your entity beans? This isn't good practice due to network issues. More importantly, JEE5/EJB 3 considers them dead and doesn't support a migration path for remote entity beans. (Remote session bean wrappers around local entity beans are fine and good practice.) Now is a really good time to consider the approach so it doesn't cause problems later.
 
Nagsen Kamble
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jeanne,

Thanks for your comments about remote and local interface in different EJB specs. But upgrading to higher one is dependent on my company's client so for now I have to stuck with EJB 1.1

Rgarding adding getters and setters, it is found that while adding CMP field using DD editor, there are options/checkboxes to generate getters and setters in remote interface and bean class. Previously I missed them and thus get/set methods were not generated.

Now I am struggling with adding Finders for entity beans (ejb 1.1). The help document embeded in Websphere are good but are not in much detail.
It will be pleasure if you give some useful online link regarding adding finders for entity beans under ejb 1.1

Once again Thanks for replying.

-Nagsen.
 
Yeast devil! Back to the oven that baked you! And take this tiny ad too:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic