ejb « Map « JPA Q&A





1. How to correctly do a manytomany join table in JPA?    stackoverflow.com

I need 3 entities: User, Contract (which are a many to many relation) and a middle entity: UserContract (this is needed to store some fields). What I want to know is the ...

2. Is it possible to override persistence.xml properties via configuration?    stackoverflow.com

JBOSS 5.1 / EJB 3 / JPA / MySQL For development we specify "hibernate.hbm2ddl.auto" as "update". This is done in several persistence.xml files embedded in several jars in an ear. For production we'd ...

3. Is package level annotations still available on EJB3 to map entities on JPA/Hibernate?    stackoverflow.com

The Problem: I have two complementary projects, a base one (Base Project) with shared entities and a specific one (Specific Project) that needs to query the entities from the first project. They both ...

4. EJB3 mapped by? whose owning of OR mapping?    stackoverflow.com

Hello everybody i wonder: when can i use mapped by to indicate whose is owing of relationship in one-to -one or one to many - or many to many relationship mapping ...

5. override persistence.xml in ejb3    stackoverflow.com

I am facing issue to override persistence.xml in jboss and with Hibernate JPA provider, I spent couple of nights but I couldn't solve it. I am using jboss + hibernate + ...

6. Map database table to a Hashtable    stackoverflow.com

I have simple table in Oracle db with the columns : "KEY", "VALUE". I would like to map this table in my java code as a is there anyway of doing this ...

7. The mystery of Java EE 6 annotations inheritance    stackoverflow.com

I'm using inheritance with EJB in a few scenarios, sometimes with annotations in the super class like this generic entityDAO:

public class JpaDAO<T>{
    protected Class<T> entityClass;

    ...

8. StackOverflowError when retriving ManyToMany join table with Java EJB 3    stackoverflow.com

I have the following entity mapings for my EJB3 application that map a many-to-many relationship:

@Entity
Crawl{
    @OneToMany(fetch = FetchType.EAGER, mappedBy = "pk.crawl")
    public List<Change> changes;
}

@Entity
Change{
  ...

9. INHERITANCE IN JPA orm.xml file    java-forums.org

Hi to all I'm working in a JPA/EJB3 project that extracts informations in an orm.xml file. In hibernate hbm.xml file it is clearly in the case of join sub class inheritance set the super class with the keyword extends. I don't know how to get the super class in orm.xml file. thanks





10. How to Do One to Many Mapping in JPA For this scenario    java-forums.org

I have a class public class ExamCategoryDTO { @Id private Long id; @OneToMany(mappedBy = "examCategoryDTO", targetEntity = ExamNameDTO.class, fetch = FetchType.LAZY, cascade = CascadeType.ALL) private List examNameList; } And another class public class ExamNameDTO { @Id private Long id; @Column(name="EXAM_CATEGORY_ID") private Long examCategoryId; @ManyToOne @JoinColumn(name = "EXAM_CATEGORY_ID") private ExamCategoryDTO examCategoryDTO; } If i do like this it gives error saying that ...

11. How to map a Map in EJB3?    forum.hibernate.org

I'm having trouble finding out how to annotate a persistent object that has a Map. I have a table that contains 3 columns, a foreign key to the persistent object's table and 2 columns that are just plain old strings. I can't figure out how to annotate this. All the examples show a map of a string to another persistent object. ...

12. Why doesn't org.hibernate.ejb.QueryImpl override toString?    forum.hibernate.org

Hi, I would like to be able to programatically get to the HQL or EJBQL string that is inside javax.persistence.Query. If I create a new Query, I can't seem to do that. The rationale for doing so is that I have a class that builds up a query programatically depending on user input passed in. I would like to unit-test that ...