Wednesday, January 6, 2010

EJB Files to be Checked Into CVS

Creating an EJB bean and best practices to checkin files into CVS for 6.0.

The most important rule, while creating EJB's is to make sure, you understand the data model and finding the composite key that would identify the table.
e.g. extending catentry_ext (catentry_id,store_id), There should be just 1 ejbcreate with both the values.
e.g. extending catgroupdesc_ext (catgroup_id, language_id), ejbcreate(catgroupId,langId)
Also making sure the finders exist with the composite key.
e.g. findByCatentryIdStoreId and findByCatGroupIdAndLangId


I have used the following link to create multiple EJB's successfully.

http://publib.boulder.ibm.com/infocenter/wchelp/v6r0m0/topic/com.ibm.commerce.developer.tutorial.doc/tutorial/ttd18.htm?resultof=%22%62%6f%6e%75%73%22%20%22%62%6f%6e%75%22%20%22%62%65%61%6e%22%20

2. I would usually be careful at step 15. to map the entity bean to the table, some times has issues when you try to map in wrong view. Other than that all other steps are required.

3. Best practice to check in files as a practice. Usually the following files are checked in and an ant task is used during build to generate all the stub classes for EJB's and access beans. It is better to not checkin all the generated classes to CVS. This approach would make it cleaner.
packagename.XXCatEntryExtBean
packagename.XXCatEntryExtKey
packagename.XXCatEntryExtHome
packagename.XXCatEntryExt

WebSphereCommerceServerExtensionsData\ejbModule\META-INF\ejb-jar
WebSphereCommerceServerExtensionsData\ejbModule\META-INF\ibm-ejb-access-bean.xmi
WebSphereCommerceServerExtensionsData\ejbModule\META-INF\ibm-ejb-jar-bnd.xmi
WebSphereCommerceServerExtensionsData\ejbModule\META-INF\ibm-ejb-jar-ext.xmi

META-INF\backends\ORACLE_V9_1\Map.mapxmi
META-INF\backends\ORACLE_V9_1\WEBSPHERECOMMERCESERVEREXTENSIONSDATA_NULLID_XX_CATENTRY_EXT.tblxmi

4.Do not check-in access beans, use a build script to create access beans, when refreshing code from version control system such as CVS or SVN.
To test it, you can use access bean to create a new row and commit.

Interesting things. Why do you use access beans?
Access beans are wrappers around EJB's that providers getters and setters to the fields and are also used to improve the performance of an data update operations, where in multiple columns are written to first Hashmap internally and committed to the database.

2 comments:

  1. Write a tutorial on how to edit with websphere developer, I stress this is not English with a translator.

    ReplyDelete
    Replies
    1. ngập bốn phía ra ngoài.

      Tu sĩ bốn phía phải vội vã nhanh chóng lui lại phía sau. Thậm chí có một số người lui lại hơi chậm, ngay khi chạm phải quang mạc đó liền lập tức kêu thảm một tiếng, thân thể lấy mắt thường cũng có thể nhìn thấy bị khô quắt lại, trở thành một cái thây khô, ngay cả nguyên thần cũng tan nát, hóa thành nguyên lực bị tấm màn sáng này hấp thu.
      đồng tâm
      game mu
      cho thuê phòng trọ
      cho thuê phòng trọ
      nhac san cuc manh
      tổng đài tư vấn luật miễn phí
      văn phòng luật
      số điện thoại tư vấn luật
      thành lập công ty

      Từ bên ngoài nhìn lại, chỉ thấy đám tu sĩ trong mắt lộ vẻ hoảng sợ lao ra, chỉ sợ tốc độ của mình quá chậm.

      Quái nhân tóc bạc cười khằng khặc, thân ảnh nhoáng lên một cái đã xuất hiện phía sau một tu sĩ Âm Hư, bóp nát thân thể hắn, trong nháy mắt khi nguyên thần tự bạo liền định thôn phệ. Nhưng đột nhiên hắn quay phắt đầu, trong mắt lần đầu tiên lộ ra vẻ kinh ngạc và nhưng trọng.

      - Đạo dung thiên địa !

      Trong lúc hắn chuyển người, đồng thời nguyên thần của tu sĩ mất đi thân thể kia tự bạo. Quái nhân tóc bạc này căn bản chẳng thèm để ý, thân thể nhoáng lên một cái không ngờ cũng dung nhập vào trong thiên địa, từng bước bước tới, gợn sóng hiện ra dưới chân hắn,

      Delete