My system should interact with several other systems, and possibly in the future. The web application has an internal data model suitable for its purpose; however, when displaying this data, the web application will need to import or display data from other systems. Specified by user. I am using EJB3, and the problem is how to load unknown tables and display their contents in a good formatted format?
Suppose you have an Entity class, for example
@Entity public class myDatas() { private String field; private Other data;
T needs to be dynamically created as a data class, since I donβt know what the data looks like. How to do it?
Is there a completely different way to do this? When should your object reference an unknown table?
Does the adapter template match for this?
EDIT: I could probably use openjpa to reverse-map the schema of external system databases to create a data class or object object. However, I am not sure if I can do this at runtime, is there no need to recognize / deploy the bean entity for AS? If this works, the hacker way would be, for example, to provide a button to retrieve the table and unbind it to the entity - bean, and then reload it in AS. But, it is so ugly ...
EDIT2 : Could groovy be suitable for something like that? I heard that it is a dynamic language.
source share