This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Regarding BigDecimal

 
Håkan Axheim
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!

Can someone give me an example of a Java code that queries a database with Hibernate with a BigDecimal value in where clause.
I want to pass a BigDecimal vale to a method. That method shall perform a query to a database.

public List<> mehtod(int intYear,BigDecimal bigDecimalValue)
{

ex. Select <column1> FROM <table> WHERE year = intYear AND value = bigDecimalvalue;

}
 
arumugarani sundaram
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
String sql="SELECT node_id FROM node_group WHERE group_id=? and group_value=?";
SQLQuery query=session.createSQLQuery(sql);
query.setLong(0,id);
query.setBigDecimal(1,bigDecimalGroupValue);
List list=query.list();
return list;
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic