File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes dynamic entity beans Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "dynamic entity beans" Watch "dynamic entity beans" New topic

dynamic entity beans

Neil Goldsmith
Ranch Hand

Joined: Nov 02, 2001
Posts: 34
In our design, we have a GUI that allows our customers to create tables and rows in those tables on the fly. We want to map these tables to entity beans, but the dilemma is, you don't know ahead of time what the tables/rows will look like, so how do you precreate entity beans that map that data? We also have a very distributed system, so creating entity beans on the fly and mapping them to all the appservers would be challenging.
I was looking for some feedback on possible solutions for this problem.
In the old world, we simply used SQL and pulled table names/rows out of the dynamic data provided by the customer. We want to use entity beans for the added benefits you get from them, but how do you make them dynamic to support a dynamic data model?
Kyle Brown
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
The answer is you don't. Don't use Entity beans for this. Use standard Java objects and JDBC just like "in the old days". A generic Java design that represents the SQL metadata as "tables" containing "rows" made up of "columns" might be your best bet. You can still get the rest of the J2EE advantages (transactions, security, etc.) by using Session beans to wrap these things.

Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at for other WebSphere information.
I agree. Here's the link:
subject: dynamic entity beans
It's not a secret anymore!