Narendra Nathmal

+ Follow
since Aug 04, 2004
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Narendra Nathmal

From what i understand (correct me if i am wrong, i am newbie to hibernate) if i want to query a column from a table i need to define a persistant storage which defines a property for this column. If a table has fifty columns which i may query i need to define all of these in the .hbm and corresponding java class.

In other words i cannot have something like this ...
<class name=name table=table>
<key ...
<property name=alias />

And my query is like this ....
select variable-col into alias from table where ....

Can i map a variable-col to a propety defined in the .hbm but for which i do not know the column name since it depends on the users request.

If this is not clear, never mind. I will wait for others to respond.

The issue really is a legacy table which has lots of columns. The table supports multiple views with common key (no normalisation here!). By view i mean not typical database views but a set of columns form a view for a key. Yes i can query all the data then pass on only column which the user is requesting. I was hoping to use the power of dynamic sql. The object need not be persisted since it is for query purposes only. I was hoping to build the query at runtime and get results in a java object. Are you suggesting not to use hibernate for something like this?

Is something like possible with hibernate

<property name="colname" column="?" />

In other words i want to selectively pick columns i want and which are not necessarity defined in the .hbm mapping file. The .hbm has only the key columns.

.hbm has
<class name="classname" table="tablename">
<id ....
<property name="colnm" column="?" />

The table in question is big with lots of columns. A user sees only certain columns which are defined in a template or wants to looks for only certain column's detail view.

How best to achieve something like this. I know with jdbc it is easy. How about hibernate??

Is it possible to build dynamic sql using hibernate. I know you can selectively query the columns definded in the .hbm files. But what if the column name is known only at runtime. In other words is something like this possible

<property name="somecol" column="?" />

The ? is the column name i am interested in??

Any ideas??
I am using WSAD 5.1 and running a JUNIT test case with hibernate. I get this error ...

mmiVerifyTpAndGetWorkSize: stack_height=1 should be zero; exit

What does this mean. My select statement is quite big. Is this the reason?

16 years ago