java - Retriving records from database using hibernate -



java - Retriving records from database using hibernate -

i have class trade , subclass operation. mapped in database. when do:

trades = session.createquery("from trade").list()

i arraylist of trade records , can access operations trade through trade instance.

however, when do:

trades = session.createquery(" trade trade inner bring together trade.operations operation to_char(operation.datetime, 'yyyymmdd') = to_char(sysdate, 'yyyymmdd') order operation.datetime" ).list();

i array of objects each element contains operation , trade instance.

how retrieve records array of trades (same first option) conditions (same sec option)?

i tried: select trade trade trade inner bring together trade.operations operation to_char(operation.datetime, 'yyyymmdd') = to_char(sysdate, 'yyyymmdd') order operation.datetime

it worked, javatestcase. however, when loop trade.operations, trades contain operations today, operations trade, if it's operation day. doesn't satisfy condition.

any clue?

thanks in advance!!

trade.operations contain operations trade. hibernate won't give trades partial initialized kid collection because breaks alter tracking , leads many confusions downwards road. best hibernate can give pairs of trades , matching operations. create class containing properties need trade , matching operation , utilize aliastobeantransformer.

java hibernate

Comments

Popular posts from this blog

delphi - blogger via idHTTP : error 400 bad request -

c++ - compiler errors when initializing EXPECT_CALL with function which has program_options::variables_map as parameter -

How do I check if an insert was successful with MySQLdb in Python? -