0

Let there be a SQL query for which I need to generate a dynamic Pojo class. So here is my question: SQL query: select msisdn,code,user from Example;

this table(Example) is having 13 columns. So how will I decide the mapping for not given columns. I mean will the dynamic pojo be created or there will be some exception. Is it compulsory to map all the columns of a relation to the pojo class?. I am new to hibernate and just heard about Dynamic Pojos. This question is just for the sake of knowledge.

UPDATE :

Let Me Clear this:

I have an app A(say, simple java app uses Oracle DB) and another as B(developed in hibernate). A interacts with B to fetch or store its data instead of directly interacting to the Oracle DB. It calls a method select(say) of B passing the SQL query(to be operated on) to it. A receives the query and Generates a dynamic POJO for the given table in the query.

Now my question is that: Will the POJO class be Generated on the basis of 4-given/requested columns in the query even if the table has 13 or more than 4 columns. If yes then how will this mapping take place. Is my question right? Am I thinking for a possible thing to happen?

yashpal bharadwaj
  • 323
  • 2
  • 6
  • 14

0 Answers0