1
has how I make a select, using the criteria and bring an uncharted entity, would be several joins, and sometimes bring certain fields and others not.
1
has how I make a select, using the criteria and bring an uncharted entity, would be several joins, and sometimes bring certain fields and others not.
2
Criteria you cannot do without an entity, but you can use Native Query to execute queries.
Query query = session.createSQLQuery("select s.stock_code from stock s where s.stock_code = :stockCode").setParameter("stockCode", "7277");
List result = query.list();
You can see more on: https://www.mkyong.com/hibernate/hibernate-native-sql-queries-examples/
Browser other questions tagged database hibernate java criteria
You are not signed in. Login or sign up in order to post.
With criteria you can get behind unmapped classes, look in the Hibernate 5.2 documentation that uses the entitymanager criteriabuilder that shows you how to do it.
– Renato Vieira Dantas