How can I create a generic EB independent of database schema ?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Sathya_Sekar
Posted On:   Wednesday, August 18, 2004 09:24 PM

Hi, I am a newbie to EJBs - so please pardon me if this is very naive. We are working on porting an existing proprietry 3-tier application to a J2ee environment. One of the features of that model was one where we could save a huge data (which cannot be accodated in a VARCHAR column) in teh database by splitting the data into chunks. For example, take a Employee database. There is a column in the Employee table called Comments which requires to save user details. The max size of a VARCHAR column in Oracle is 4000 characters. So to accomodate longer texts, we create a child table called EmployeeComments with columns : Column Name : Column Type EmployeeID : integer    More>>

Hi,

I am a newbie to EJBs - so please pardon me if this is very naive.

We are working on porting an existing proprietry 3-tier application to a J2ee environment. One of the features of that model was one where we could save a huge data (which cannot be accodated in a VARCHAR column) in teh database by splitting the data into chunks.


For example, take a

Employee
database. There is a column in the
Employee
table called
Comments
which requires to save user details. The max size of a VARCHAR column in Oracle is 4000 characters. So to accomodate longer texts, we create a child table called
EmployeeComments
with columns :

			
Column Name : Column Type
EmployeeID : integer
Comments : Varchar




So a 12000 character long comments would span 3 rows in this table. When data is to be displayed, we accumulate data across all rows for the EmployeeID.




We want to extend this to the new J2EE environment. It is easy to create a business-specific bean which would collect the data from the rows. But I was wondering whether we could create a more generic model which could be used by other applications having a similar requirement. The constraint is that the schema (table name, column name and the primary key) might vary from application to application.


Any suggestions on what would be the best approach to take ? Would creating an abstract class allowing for further extensions into which the EJBs would call in be best ?



Sorry - my thinking is restricted by my limited knowledge of EJBs.



Any suggestions/links would be most welcome.


TIA.    <<Less

Re: How can I create a generic EB independent of database schema ?

Posted By:   Raj_Subramani  
Posted On:   Thursday, August 19, 2004 01:52 AM

IMHO, this does not appear to be an EJB problem, rather a misdirected DB design problem.



Surely, EmployeeComments, must be declared as a CLOB which (when I last looked) had a limit of 4GB in Oracle.



Cheers

-raj

About | Sitemap | Contact