cancel
Showing results for 
Search instead for 
Did you mean: 

Demo J2EE application using dictionary project. on netweaver dev studio 7.1

Former Member
0 Kudos

Hi,

Can anyone point me to any documentation which shows how to develop a sample j2ee demo which includes dictionary project on sap netweaver developer studio 7.1.

I was refering to http://help.sap.com/saphelp_nw04s/helpdata/en/b5/8aa8d84f758b4e9fa20a6c12f5e647/frameset.htm but the documentation is based on a different version of netweaver studio.

Thanks and Regards

Siri

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi, Siri,

Unfortunately, the tutorial you are viewing has been excluded from the official Developer's Guide for NW 7.1.

Could you please specify what exactly do you need? Is it the general scenario on how to use Java Dictionary and how it fits in the Java EE application development process or you just want to create a Dictionary project using the latest NW Developer Studio?

Regards,

Yordan

Former Member
0 Kudos

Hi Yordan,

Thank you for the reply.

I am kind of new to netweaver dev studio so i was trying to learn about it by building some sample demos.I managed to get hold of some tutorial and sucessfully built a sample j2ee application which uses a dictionary project :).But i still have a few doubts over here

1.How to automatically create an entity bean from a database table.When i right click on a database table and say create an entity bean a window pops up and there when i try to browse for a project folder it shows me a blank list.I even tried adding an ejb project as reference to my dictionay project but still when i try to browse for a project to create an entity bean it shows a blank list.

2.When i deploy my dictionary project by default the tables are getting created in the default database of the SAP server.Is there a way to configure that database and point it out to a different database on that server.Or is it like the dictionary project works only with the default databse.

3.How do i deploy my tables to any other database apart from MaxDB,like mysql,mssql..

Thanks and Regards

Siri

Former Member
0 Kudos

Hi, Siri,

SAP NetWeaver Composition Environment (CE) 7.1 comes with Application Server (AS) Java, which is based on the Java EE 5 technology. Java EE 5 provides a dedicated application programming interface (API) to deal with persistent data - this is what is called JPA (Java Persistence API). When you work with JPA, persistent data is represented by the so called entities (entity beans are part of the J2EE 1.4 technology and are not used in Java EE 5). These entities are plain old Java objects, which you map to database tables during the application development process. You can read more about how to work with persistent data in Java EE 5 environment on the following link:

http://help.sap.com/saphelp_nwce10/helpdata/en/61/fdbc3d16f39e33e10000000a11405a/frameset.htm

...and in particular with JPA:

http://help.sap.com/saphelp_nwce10/helpdata/en/44/eba6292f446c30e10000000a114a6b/frameset.htm

So, regarding the information above, and considering that you do not want to work with entity beans on purpose (if this is the case actually), here are the answers of your questions:

1. Yes. You can create entities from database tables automatically. The guidelines for this procedure are given in the following document:

http://help.sap.com/saphelp_nwce10/helpdata/en/44/edbd4aa338108ee10000000a11466f/frameset.htm

2. The restriction for using Java Dictionary for defining your tables is that you have to use OpenSQL to access your database. Therefore, it is not obligatory to use the system database - you just need the database specific driver to connect to another DB. The procedure for connecting to a database is described on the following link:

http://help.sap.com/saphelp_nwce10/helpdata/en/44/ea0bcbbd786c33e10000000a114a6b/frameset.htm

3. Deploying database tables is described here:

http://help.sap.com/saphelp_nwce10/helpdata/en/f4/44a80fa44ced4ea67c182402818452/frameset.htm

...i.e. there is no much difference in the deployment procedure. You just need the particular database driver to connect to your database.

Overall, you can read more about Java Dictionary here:

http://help.sap.com/saphelp_nwce10/helpdata/en/69/f9bc3d52f39d33e10000000a11405a/frameset.htm

Hope that helps!

Regards,

Yordan

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Yordan,

Thank you for the links.They really helped me in understanding JPA and rest.

I have one doubt over here.The scenario is,

1.I created my dictionary project and deployed it.

2.I created entities for my database tables ,created an ejb project and deployed it .

3.Now i added a few more columns to my database tables.How do i make my application pick those changes up.

For updating data and other data related operations, i am using EntityManager object ,but the question is how do i update my application if my table structure changes.

Thanks and Regards

Siri

Former Member
0 Kudos

Hi, Siri,

What comes to my mind in a situation like yours, is that once you have changed your tables in the database, you can simply re-generate your entities.

To do this, see Step 2 in the following procedure ("Creating Database Tables and Generating Entities"):

http://help.sap.com/saphelp_nwce10/helpdata/en/44/edbd4aa338108ee10000000a11466f/frameset.htm

You have to re-create and re-deploy the EAR-file afterwards.

I hope this helps!

Regards,

Yordan