table « Entity « JPA Q&A





1. Populate envers revision tables with existing data from Hibernate Entities    stackoverflow.com

I'm adding envers to an existing hibernate entities. Everything is working smoothly so far as far as auditing, however querying is a different issue because the revision tables aren’t populated with ...

2. Reading from multiple tables and populating multiple entities using JPA SqlResultSetMapping    stackoverflow.com

I have been building a JSF application using JPA to access the DB. There are a number of entities. I want to create a search results screen that shows columns from more ...

3. 2 JPA entities on the same table    stackoverflow.com

Let's say I've a table with 200 columns and most of them are never used. I map SmallEntity to the 10 columns that are used often. I use it in the associations ...

4. Can I create many tables according to the same entity?    stackoverflow.com

What I want to do is that I want to make the many tables dynamically which are the same entity structures. And then I want to refer to the dynamically created ...

5. Which tables must be defined as Discriminated Entities on Hibernate?    stackoverflow.com

I want to develop a blog and image gallery system. My db schema likes below; IMAGE {table}  | ARTICLE{table}    | COMMENT{table}
-------------------|------------------------|-----------------------
PK id;              | PK id;                    | PK id;
PATH ...

6. hibernate won't create table    stackoverflow.com

*I got the following in an entity.

@Entity("User")
public class User implements java.io.Serializable {
    @ElementCollection(fetch=FetchType.EAGER)
    @CollectionTable(name="FrameworkUser_Properties")
    public Map<String, String> getProperties() {
    ...

7. Hibernate entities without underlying tables    stackoverflow.com

I have a really ugly legacy database system that I need to integrate with. Essentially I'm doing some read only reporting on the system, and I don't want to set ...

9. Reverse Engineering: From Tables to JPA entities    coderanch.com

Hello, I need to generate a business application model as JPA entities from the raw tables of a given Data Base. I know that the E/R model is more poor than the OO model, but I assume the loose of information. What I need to know is if somebody knows any tool or framework that offers an API that fulfill this ...





10. Two Entities for the Same Table?    forum.hibernate.org

Is there anything wrong with having two entities for the same table? I currently have a table with 300+ columns. I also have a search engine that only needs about 10 of these fields. I thought of creating a view in the database, but need to be able to fetch one-to-many associations (open session in view pattern) on occassion. I created ...

11. one entity Multiple tables    forum.hibernate.org

I am not meaning one pojo with its fields in different tables. I mean one pojo with multiple tables which own the same structure. Since I am fraid the table may change too large,so I wonder if there is any way? I have read the docs of hibernate shard,however I found it is rather complex...

13. Hibernate tries to create same Entity/Table twice - why?    forum.hibernate.org

Hi All, I am using hibernate with my J2EE app deployed on JBoss 6.0. My database is Oracle 11i and Derby. For generating primary-key (running serial Id) I use @TableGenerator annotation in one of my Entity (PersonDTO) - like: @Entity @Table(name = "EDIS_PERSON") public class PersonDTO { @Id @TableGenerator(name="TABLE_GEN", table="EDIS_SEQUENCE", pkColumnName="SEQ_NAME", valueColumnName="SEQ_COUNT", pkColumnValue="PERSON_ID", allocationSize = 5) @GeneratedValue(strategy=GenerationType.TABLE, generator="TABLE_GEN") private long id; ...

14. Hibernate Table Problem Entity    forum.hibernate.org

15. Entity across several tables    forum.hibernate.org

I have a similar problem. I read the "delegate" pattern and it doesn't work for me. The problem is that the example is using the I think it should use "foreign". With "assign" I have to assign the id manually. Example: session.save(customer); customerHistory.setId(customer.getId()); session.save(customerHistory); I think this doesn't look good. What if I have 5 objects like CustomerHistory? I ...

16. Set with entities from several tables    forum.hibernate.org

Hello, I have an one-to-many association from entity E1 to entity E2. This is the logical association. In the real world, I'm gonna add E2 subclasses inside mySet, like E2a, E2b .... How can I do that ? thanks Alexandre Gomes





17. How to get table index created on many-to-many entity    forum.hibernate.org

Hi all, I'm trying to get hibernate to generate at least one index on a many-to-many association entity. I have users registering on a web site and selecting one of a set of possible answers for each question posed on the registration form. The effected entities are RegistrationProfiles and PossibleAnswers. Hibernate successfully generates DDL to create an association table called SelectedAnswers ...

18. Audit information to SAME table as entities?    forum.hibernate.org

Is it possible to use Hibernate (2.1.8) Auditable and Interceptors to populate audit information (date, user) to fields in the same table that maps to a given entity? Say I have Customer which maps to the CUSTOMER table and want the fields LAST_MOD and LAST_MOD_USER to be populated. And I also have Order which maps to the ORDER table, and has ...

19. 2 tables in 1 entity    forum.hibernate.org

Do you mean something like this Code: ...

20. Entity without table    forum.hibernate.org

21. dynamicly change an entity's refrence to a table    forum.hibernate.org

22. Persisting an entity across two normalized tables    forum.hibernate.org

... ...

23. One Entity, Multiple Tables?    forum.hibernate.org

Hello, I am new to Hibernate and am trying to convert a system using Oracle ORM framework to Hibernate. One issue I am currently having is I would like to map an Entity or POJO to multiple tables (or better yet some sort of custom query). I'm using annotations so what I have so far is akin to... Code: @Entity @Table(name ...

25. JPA: @Entity with no @Table    forums.oracle.com