java - hibernate projection unique list -


I am trying to use hibernate and projection, which can result in a list that does not have duplicate content .

I have a square CurrEntityProfileBO, it has the property unit id.

  Criteria Criteria = Sessions .createcriteria (CurrEntityProfileBO.class, "entityProfileBO"); Criterion Source publication (Projections. Projection List). Add (Projections Property ("Unit ID"));  

I'm getting an exception:

  [2014-11-04 11:28:59] error [http-8080-5] (SqlExceptionHelper .Java: 144) - ORA-01791: Not a Selected Expression [2014-11-04 11:28:59] Warning [HT-8080-5] (AbstractsHandler Expression Solver. Jawaator 85) - Exception Org Hibernate as a result of handler execution. Exception.SQLGrammarException: ORA-01791: org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert is not a selected expression (SQLExceptionTypeDelegate.java:82)  

Any help appreciated! According to

sp00m criteria.setResultTransformer (CriteriaSpecification.DISTINCT_ROOT_ENTITY);

Works very well!


Comments

Popular posts from this blog

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

c - What is the address of buf (the local variable in the main function)? -