java - BigDecimal CastException in hibernate -


I am using a bean object to retrieve data from the database, which is called AudienceInfo two features in the Audiences Are:

  public string message body; Public is BigDekelal Audience;  

The database does not have body varchar2 and number of viewers in the database. To get data in the DAO class, everything is fine and data has been selected. But when I pass an object (customer) form Dao class in my main class, there is an error. Here's my code in the main code:

  Iterator & lt; AudienceInfo & gt; Iterator = Customer.itator (); Int i = 0; While (ifr. HasNext ()) {BigDCULUM COM = (Customer Gate (i) .getAudienceno ()); String msgBody = customer.get (i) .getMessageBody (); Iterator.next (); ++ i; }  

error is:

  Exception in thread "main" java.lang.ClassCastException: java.math.BigDecimal not inserted for com.htsc .sms.model.bo.AudienceInfo  

When I use this code in jdbc, everything is fine and I can see the result set but in hibernation, is.

<

  query query = /> 

I got my own answer: addScalar in query The problem was resolved by using


Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -