entity « Load « JPA Q&A





1. Entity to DTO conversion with JPA    stackoverflow.com

I'm using DataNucleus as a JPA implementation to store my classes in my web application. I use a set of converters which all have toDTO() and fromDTO(). My issue ...

2. How to load entity inside another entity?    stackoverflow.com

I have a problem joining tables to retrieve information I have three tables:

  1. city (city_id, name) - information about the city.
  2. state (state_id, name) - information about state
  3. city_state_map (city_id, state_id)
and I have two hibernate ...

3. Hibernate: Load entities with Formula    stackoverflow.com

Is it possible to load an entity using a Formula? For example:

@formula("(select * from myEntity ent where ent.isLatest = TRUE )")
publicmyEntity getmyEntity()
{
    return this.associatedPatientJournalEntries;
}
if so, how does the mapping ...

4. could not load an entity - JPA and Hibernate    coderanch.com

Sorry for the title, I could not think of anything more descriptive about the problem I'm having right now. I was trying the netbeans 5.5 CRUD functionality with JPA and Hibernate. I'm getting the following errors below... HTTP Status 500 - -------------------------------------------------------------------------------- type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. ...

5. how can I load entities from external jar?    forum.hibernate.org

Newbie Joined: Mon Dec 14, 2009 5:38 am Posts: 13 Hello, I have a code below that supposedly to load an entity from an external jar. The jar is not within classpath. Code: AnnotationConfiguration ac = new AnnotationConfiguration(); try { File ...

6. NPE trying to load Entity (NativeSQL) with Formula    forum.hibernate.org

Hello, i got a NPE when trying to load an Entity that has a Formula definied. For loading the Entity i use a native Query. something like this: Code: Query query = this.em.createNativeQuery(sql.toString(), Customer.class); The Query: Code: [#|2010-09-15T11:41:51.946+0200|INFO|glassfishv3.0|javax.enterprise.system.std.com.sun.enterprise.v3.services.impl|_ThreadID=31;_ThreadName=Thread-1;|QUERY: SELECT G.* FROM CUSTOMER G, CUSTOMER_RELATION R WHERE G.ID = R.REF_GP2 AND R.RELTYP IN ('ZI1', 'ZI2', 'ZI3') AND R.REF_GP ...

7. Using Stored Procedures to load entities    forum.hibernate.org

Hi all, I'm trying to convert one of our applications to Hibernate. One of the problems is that all DB access needs to be done via Stored Procedures, so I fear I'm diving in at the deep end here. Anyway I'm trying to set up the custom SQL for loading an entity. I have a Stored Proc which takes the primary ...

9. Lazy-load part of entity    forum.hibernate.org

Hm..can't find in DTD and documentataion: can Components can be load-on-demand? I have entity object, which have one property - text, mapped to CLOB, and the size of this text can be rather big (about 1Mb for instance) I have 2 web-pages: 1 - displays my entities info, without that text. 2 - displays detailed info about entity. So, i wonder ...





10. Selective Loading (partially populating an entity object)    forum.hibernate.org

Hibernate version: 216 This question applies more to the design than implementation - hence no code is provided. A very simple scenario: I have an entity object called User.java which has 6 fields (consider all of them Strings for now - except the id field) : - id - name - email - phone - dob Which maps to a MySQL ...

11. strange loading of entity that doesn't exists    forum.hibernate.org

I'm facing a very strange behavior of session.load(MyClass.class, ). Hibernate give me back an object (MyClass$$EnhancerByCGLIB$$...) even if the row with primaryKey doesn't exist in the database table. I expected an Exception instead of these proxy object. Changing the code to session.get(...) than the result is null. I'm using hibernate-3.2cr1 with hibernate-annotations-3.1beta9 (build the day before yesterday from SVN). Any help ...

12. Loading a collection for an entity created from a scalar    forum.hibernate.org

Beginner Joined: Mon Nov 07, 2005 11:10 pm Posts: 30 Hibernate version: 3.1.2 Mapping documents: Code: true ...

13. unnecessary (?) loading entities    forum.hibernate.org

SELECT id, url, htmlFROM ( SELECT url_id, html FROM gzhtml WHERE url_id NOT IN ( ...

14. load() problem: Unknown entity    forum.hibernate.org

Hi, I get my Company from the Hibernate Session though a get() call successfully. I store this in my HttpSession and upon the next request I call load(myCompany, myCompany.getId()) to reassociate it with the new Hibernate session. I get the exception as shown below though. It seems as if the proxy gets retrieved and stored in the HttpSession and Hibernate doesn't ...

15. could not load an entity    forum.hibernate.org

Hibernate version: 3.2 Mapping documents: addressdata.hbm.xml ...

16. Lazy Loading loading untouched entities    forum.hibernate.org

PaperworkFolder.hbm.xml PW_FOLDER_SEQ ...





17. Could not load an entity occasionally    forum.hibernate.org

My program fails to load entity but pass on second time without modification. Before failure, my program can load entity well and the "error record" is existing on DB. The program can always work fine. Only occurs the mentioned problem sometimes. Does anyone have experience on it? or any suggestion to make the program occurs the error again? Thanks a lot! ...

18. Not able to load Entity    forum.hibernate.org

19. "could not load an entity:" while getting a specif    forum.hibernate.org

Hi, I'm using hibernate with spring DAO support.I have this problem that doesn't occur on localhost.Mysql versions and configurations are different on localhost and the remote server(for example lower case table names was my first problem).But I couldn't figure this out. As I've said it occurs only on the remote server and only on this table(Kitap_Istek). Only happpens on Code: public ...

20. multi loading of entities    forum.hibernate.org

Hi, I have multiple, independent modules that holds reference to the same (persisted) entities. question is: if I load them independently from each module, will Hibernate return the same references each time, or will it, for every call, generate new instances with the same data (that is, allocate NEW objects for each load)?

21. Asynchronous loading of entities using hibernate    forum.hibernate.org

Hi, I am using hibernate and i need to load all the objects during my application start up, so that these objects can be queried using HQL for specific resultsets while navigating through the application. Please suggest me whether asynchronous way of handling this is possible. By the way i understand that HQL uses the entities in cache first , and ...