This content has been marked as final. Show 2 replies
If you are using TopLink and need dynamically generated queries, why not use TopLink Expressions for your queries, and return java objects back. Then you can display which ever fields from the fully populated objects that you need.
See the docs for TopLink queries here:
A simple example returning all systemdefinedObjects would be:
ReadAllQuery query = new ReadAllQuery(systemdefinedObject.class);
Collection<systemdefinedObject> results = session.executeQuery(query);
This allows populating the cache and for caching the statements and the query results.
But I'm not sure exactly what you are after.
Thanks for your Reply. I am new to Oracle toplink. Actually i need to get the particular columns in systemdefinetable and dynamic cols(col1,col2......col50) from userdefined table which has one-one relationship. so i didnt find related sample using expressions. so i had written below code by framing sql query into one stringbuffer
Query query = getSystemEntityManager().createNativeQuery(sb.toString());
List result = query.getResultList();
Now i want to bind this dynamic columns list into jspx page. How can i achieve this? In this columns will be decided at runtime so i can not use static columns in the jspx page. could you Please help me out.