native « Load « JPA Q&A





1. Load only some columns with Hibernate native SQL queries    stackoverflow.com

I have a table on the database and I want to load only some columns from the result set, because the main object mapped in Hibernate has a relation with itself ...

2. how to force hibernate to load data from database?    stackoverflow.com

Problem with hibernate: I update a column "count" in a table "data" with a native query in my source code. Later I want to load all rows from table "data" but the ...

3. native subquery in from clause fails to properly load result    forum.hibernate.org

Newbie Joined: Sat Mar 06, 2010 6:56 pm Posts: 1 Hi all, Trying to run a native query using a subquery in the from clause to find table entries that have the same name but different versions when joined with another table. When I run the query below in a console window, results are as expected, I get both lab_archive objects ...

4. Loading childs with a native SQL    forum.hibernate.org

Hi all, I was wondering if it was possible in a single native SQL query to load some entities and the associated childs. For example: sqlQuery = "select parents.* from ParentTable parents inner join ChildTable childs on parents.id = childs.parent_id"; Query query = getHibernateSession().createSQLQuery(sqlQuery).addEntity(ParentEntity.class); And I want to have the childs of each parent already filled in. Is it possible? What ...

5. Problem loading collection property with native sql    forum.hibernate.org

Hello, I am hoping someone here can help as i am at my wits end. I am trying to map a one-to-many relationship between two tables that have composite primary keys using native sql as no foreign key relationship exist between the two tables. Please not this is a legacy schema that i cannot change From hibernate documentation it seems this ...

6. Native SQL to load a mapped class with COMPOSITE key??    forum.hibernate.org

Hi, all. I'm SO close to getting this working! Argh! :-) I can't figure out how to use native SQL to populate a mapped class with a composite primary key. It keeps saying "Column CL1_0_ not found". I'm pretty sure it's looking to load up the PK. This is just about the last thing I need to get off the ground. ...

7. eagerly loading a many-to-one property in native SQL    forum.hibernate.org

I eagerly loading a many-to-one property in native SQL. My current solution involves adding a return-join element to my query declaration for the many-to-one property I am eagerly loading. A consequence of my current approach is that my result set is returned as an array. Please see below. I don't need the result set to be returned as an array, since ...

8. z/OS and WAS6: Failure in loading T2 native library db2jcct2    forum.hibernate.org

Hi everybody. We have an Application running on a WebSphere Application Server 6.0.2.15. We use Hibernate Version 3.1.3 with IBM DB2 v7.1. Everything is running under z/OS Version 7. Since the database is running on the same machine, we want to use the IBM DB2 JDBC Universal Driver using JDBC Level 2. For Level 2, the JDBC Driver requires native libraries, ...

9. Collection loaded with Native SQl Query    forum.hibernate.org

Author Message jsnyps Post subject: Collection loaded with Native SQl Query Posted: Fri Jan 26, 2007 4:13 pm Newbie Joined: Fri Jan 26, 2007 3:43 pm Posts: 1 I'm having some trouble using an @Loader annotation to load a collection from a Native SQL Query. The parent entity is also loaded by a Native SQL Query. The only error ...





10. Loading collection using native SQL -- wrong results    forum.hibernate.org

I'm trying to load a collection (set) through the mapping file using native SQL. The problem I'm encountering is two-fold: the set size is zero or one, and the entity loaded in the set is incorrect. Here's a simple test case that shows the problem: Tables: Code: drop table employee; drop table department; drop table company; create table company (company_id numeric ...

11. Possible to load Map with native SQL?    forum.hibernate.org

Is it possible to load a Map with the native SQL functionality in Hibernate 3.2 (e.g. )? I know you can do sets/bags/lists, and the documentation is decent on that. However, I have not been able to determine (nor have I been able to make it work) if Maps are supported. Has anybody gotten this to work? Thanks, Scott