-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: createSqlQuery in session interface
PostPosted: Tue Dec 21, 2010 6:29 am 
Newbie

Joined: Tue Dec 14, 2010 7:48 am
Posts: 10
List<LoanDar> loanDarList;
String darflag="R";

Query q=getSession().createSQLQuery("select loan_dar.loan_account_id,loan_dar.transaction_date,loan_dar.due_date,loan_dar.principal_amount,loan_dar.interest_amount,loan_dar.penal_amount,loan_dar.dar_Flag,loan_dar.current_Due,loan_dar.installment_no,loan_dar.fc_entered_date,loan_dar.prin_balance,loan_dar.int_balance,loan_dar.prin_overdue,loan_dar.penal_overdue from loan_dar left outer join gl_txn_ledger_master on gl_txn_ledger_master.fc_gl_txn_id=loan_dar.gl_txn left outer join gl_txn_ledger_entry on gl_txn_ledger_entry.fc_gl_entry_id=loan_dar.principal_gl_entry and gl_txn_ledger_entry.fc_gl_entry_id=loan_dar.interest_gl_entry and gl_txn_ledger_entry.fc_gl_entry_id=loan_dar.penal_gl_entry left outer join user_table on user_table.fc_user_id=loan_dar.fc_user_id where loan_dar.loan_account_id='"+account+"' and loan_dar.dar_Flag='"+darflag+"' and loan_dar.transaction_date<'"+dueDate+"' ");
return q.list();

iam using this query this is executing fine in postgre console but this code is not working


Top
 Profile  
 
 Post subject: Re: createSqlQuery in session interface
PostPosted: Tue Dec 21, 2010 7:07 am 
Regular
Regular

Joined: Fri Nov 12, 2010 4:13 am
Posts: 81
Location: India
Can you please post entire business model?? It will help to know whats the problem.

_________________
Thanks & Regards,
Chirag


Top
 Profile  
 
 Post subject: Re: createSqlQuery in session interface
PostPosted: Wed Dec 22, 2010 2:46 am 
Newbie

Joined: Tue Dec 21, 2010 8:21 am
Posts: 5
Hi,
have u tried this if not try the below one instead of (Query q=getSession().createSQLQuery)

try this
String queryString="";
Query q=session.createQuery(queryString);


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.