java - Hibernate expecting wrong parameter type in HQL -


We have a hierarchy of institutions, e.g. Intangible baskets and two concrete, which in turn can be a list of some other items, for example, with precise hierarchy (Salebaketitum, Return Basketum).

  @Entity @XStreamAlias ​​( "Basket") @DiscriminatorColumn (name = "basket_type") @DiscriminatorOptions (force = true) @Inheritance (strategy = InheritanceType.SINGLE_TABLE) public abstract class basket & Lt; T basketball title & gt; @ Entity @ Dispinning value (value = "cell") Public class sales bucket basket spreads & lt; SalesBackTime & gt; @ Entity @ Desirminator Value (value = "return") Public class return basket basket expanded in & lt; ReturnBasketItem & gt; @Entity @Table (name = "basket_item") @XStreamAlias ​​( "basket_str") @DiscriminatorColumn (name = "basket_item_type") @DiscriminatorOptions (force = true) @Inheritance (strategy = InheritanceType.SINGLE_TABLE) public abstract class BasketItem & Lt; U spreads basketsim, v basket; @ Entity @ Dispinitator Value (Value = "Return") Public Class Return Baskets item item expands basket etam & lt; Return basket item, returnbacket & gt; @ Entity @ Desirminator Value (Value = "Sale") Public Category Sales Basket Uses Basket Extension of Itam & lt; SalesBacketime, SalesBasket & gt;   

So, the problem arises when I choose like HQL query to execute

  + basketType + "BasketItem bi-bi" " join join b.saleSession join tried bi.basket b are bi.ware W where b.state =: state "  

where basketType Dynamically either "sale" or "the return". I TypedQuery he put the query BasketItem is the type of I need setParameter ( "state", state) , where

IllegalArgumentException (java.lang .IllegalArgumentException throws: parameter value ... did not match the mail type)

where type ReturnBasketState when the That is SaleBasket state, or vice versa.

So the question is how to be in hibernation is the right kind of hope for that parameter?

I think it is in the form of parameters rather than a single anonymity than a string. Instead try to pass a string.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -