entity 2 « Entity « JPA Q&A





1. Can't understand why a related entity is being flushed    forum.hibernate.org

Beginner Joined: Wed Nov 30, 2005 10:25 pm Posts: 25 I am getting an error from one of my test cases. The test case involves a user attempting to delete an Address of a User that they don't have permission to. What is odd is that hibernate seems to be attempting to save the user object which I have not altered. ...

2. Inspecting whether an entity has changed its state    forum.hibernate.org

You can get informed by Hibernate if you write an Interceptor. For example see this: Code: public class HistoryInterceptor extends EmptyInterceptor { (...) public boolean onFlushDirty(final Object pEntity, final Serializable pId, ...

3. Howto dublicate entity    forum.hibernate.org

4. Designing monitoring for entities    forum.hibernate.org

Hi there, I am having a design question I would like to get some feedback on. Since the core of the application using Hibernate together with Hibernate Annotations I thought I post the question here first. Maybe there is neat little Hibernate feature I could use? Here is the problem. I have a Company entity with the usual properties like name, ...

5. Weak Entity    forum.hibernate.org

Hi, I have a Java class named File and another one named FileData. Conceptually these are only one class, but I need this separation because design reasons. The File class has an Id field, but the FileData class hasn't one of its own because it's only extra information for the File class.... so, in the database, FileData would have a foreign ...

6. Entity implementing ExternalizableLite    forum.hibernate.org

Hi, My project uses Hibernate and Coherence as L2 Cache. I happen to view through a forum for implementing the ExternalizableLite interface by CacheEntry class in hibernate.jar. I learnt that CacheEntry is an Cached Instance of an Entity. My question is, whether my Entity objects need to implement ExternalizableLite to unleash the Performance or is it fine if we do at ...

7. Question - Returning Non-Managed entities    forum.hibernate.org

8. can i undo changes on existing entities?    forum.hibernate.org

greetings! to put this simple, let's see a example: Party p = em.find(Party.class, id) PartyDetails pd = new PartyDetails; ... // a party can have multiple details, and order number is maintained to // connect with the latest version of details pd.setParty(p); p.setOrderNumber(p.getOrderNumber()+1); pd.setOrderNumber(p.getOrderNumber()); ... so to save changes on p object practically i have to do nothing more, and to ...

9. help getting JPA entity recognizing isXXX() as getXXX()    forum.hibernate.org

I am trying to get Hibernate to recognize an isOffLine() method. It works fine when the method is getOffLine(), but I do not want to change it because of depending classes. Is there a way to configure Hibernate to recongize the isXXX() instead of getXXX()? Here is the error: WARN 22-07 15:35:17,324 (ProxyHelper.java:unwrapField:56) -Could not find getter method to check for ...





10. help with JPA entity    forum.hibernate.org

Author Message rabies Post subject: help with JPA entity Posted: Fri Aug 22, 2008 3:01 pm Beginner Joined: Thu Apr 03, 2008 2:34 pm Posts: 31 JBoss EAP 4.3.0_CP01 Seam 2.0.1.GA Hibernate 3.2.4.sp1.cp03 Windows 2003 I have a Seam app which is using JPA/Hibernate as its persistence provider. I have a form with multiple input fields (h:inputText, h:selectOneMenu). Some ...

11. Assiciating to sam entity    forum.hibernate.org

Hi, I am using Person.hbm.xml file,in that person manager is one of the type, here personManage is many to one relation ship.while saving the person object without person manager i am getting nested excepetion org.hibernate.TransientObjectException.canaot save transiant variables. here i am providing the select box to select manager type nad manager for the paticular person.but it is not saving without person ...

12. Automatic deployment (discovery) of entities    forum.hibernate.org

I am using hibernate with a Spring container with annotations and Hibernate Entity Manager (not JPA). We're using Tomcat, Jboss and Weblogic and need to support those AS and maybe more. The entities deployed on the system need to be customized with a kind of plugin architecture so we should provide the ability to anyone to,say, deploy a jar file with ...

13. READ_ONLY entity throws because not MANAGED with 3.3.1.GA    forum.hibernate.org

Yesterday I downloaded Hibernate 3.3.1.GA and tried it with our application (in our production version we are using 3.2.6.GA). I soon ran into an exception which is not thrown using version 3.2.6. We have some basic read only data in our application, i.e. status entities. These entities do not change and therefore are held in cache marked as READ_ONLY. Now there ...

14. Integrate entities of different applications    forum.hibernate.org

Hi, I have two entities mapped in two different applications. Lets say the fist entity is Company in the application Company Management, which manages companies and information about them (size, address, associates, subsidiaries among others). The second entity is Risk in the application Risk Management, which manages the risk of credit of a given Company. Both applications are implemented in Java. ...

15. Entity loader and NamedNativeQuery    forum.hibernate.org

Newbie Joined: Tue Jan 20, 2009 12:41 pm Posts: 1 I'm using Hibernate 3.2.6.GA as JPA implementation on Oracle 10g. I have entity: Code: @MappedSuperclass public abstract class KeyedItem implements Keyable { @Id @Column(name = "KLUCZ", unique = true, nullable = false, precision = 9, scale = 0) private Long key; ...

16. versioned entities in Hibernate?    forum.hibernate.org





17. How to model status and status history of an entity    forum.hibernate.org

Hello, I have a Person and the Person has a current status. The status can change, but I want to keep track of the status. That means that the person entity has two links two the status table. A one-to-one for the current status and one-to-many for the status history. Code: CREATE TABLE "Person" ( "ID" NUMBER(19,0) NOT ...

18. java.lang.NoSuchMethodError after instrumenting entity    forum.hibernate.org

Hibernate Core : 3.3.0.SP1 Hibernate Annotations: 3.4.0.GA Hibernate Commons Annotation 3.1.0GA Javaassist: 3.4 GA Hi, I am trying to instrument an entity with javaassit InstrumentTask for the following given entity Code: @Entity class ABC extends CommonBusinessObject { ... @Basic(fetch = FetchType.LAZY) public java.sql.Timestamp getHistoryDate() // overrides method implementation from super class ...

19. Returning Hibernate Entities in JAX-WS response    forum.hibernate.org

Hi all, I'd like to return some Hibernate 3 entities in the responses of WebServices exposed throught JAX-WS RI in Tomcat 5.5. Because I need to do some property lazy fetching on this entities, I use Javassist instrumentation. Basically, it automatically adds new properties to my entities. Types of this new properties are not simple types or classes but they are ...

20. How do I get SQLQuery to Return the following Entity    forum.hibernate.org

For various reasons beyond the scope of this question, we persist certain POJOs (DocumentAttribute) in multiple tables . To get hibernate to play nice with this arrangement, I use a SQL query to retrieve data. What I'd like to do is retrieve the Document POJO using the following method , but Hibernate/SQL is only happy retrieving the DocumentAttribute object. If I ...

21. @NamedNativeQuery , why only once pro entity    forum.hibernate.org

hi, as the topic says I have a case where my entity is result of N search criteria, and different selects are needed to get this results. I don't understand why is the @NamedNativeQuery allowed only once pro entity and even why it is supposed to be in the entity itself, after all we specify resultClass so it might as well ...

22. Entity(dinamicInsert, dinamicUpdate)    forum.hibernate.org

23. Newbie question - hibernate overwrites entities    forum.hibernate.org

I have a sample controller that inserts my objects and it works perfectly. Only problem is that when it creates the entries the first time, it appears that it only updates them the next time and does not actually create new entries. Every time I run my app, I would expect to see a new row - instead I see the ...

24. Problem with @Entity    forum.hibernate.org

Hi, I am new to hibernate and i am looking out for a help. I tired the hibernate working with *.hbm.xml and *.cfg.xml files. I am now trying to run a sample using hibernate.properties and @Entity in the classes. I face a problem here I tried to minimize the using *.hbm.xml file instead I opted to use @Entity in class, etc. ...

25. additional methods in hibernate entity    forums.oracle.com

I added couple of additional methods in my entity pojo , just to avoid repeating same code everywhere ,like [CODE] public void removeProperty(PropertyVariable propertyVariable){ WFProperty wfProperty= getWfProperties().get(propertyVariable); if(wfProperty!=null){ getWfProperties().remove(propertyVariable); } } [/CODE] this pojo has Map WFProperties i added this additonal method to avoid the same check in several places , I want to know the if its not good practice ...

26. What would be my JPA Entities ??    forums.oracle.com

Hello Everyone. I have a confusion. In my database i have 3 tables. 1) University (id, Name) 2) Specialization (id, Name) 3) Degree (id, Name) and one relationship table. 4) degree_prog_replationshiip (id, university_id, specialization_id, degree_id) i am not able to design my entity classes. Please tell me how would be my entity classes? Thanks.

27. JPA - Shared Entity    forums.oracle.com

Hi All, I am using JPA (Hibernate), and I am stuck... I have an Address class, and a Customer class. Customer has different types of Address, fixed (One), delivery (Multiple) and charge(Multiple). If I try to map with OneToMany and OneToMany for delivery and charge, JPA will create a table with a customer PK, delivery PK and charge PK, and every ...