glassfish « Map « JPA Q&A





1. copy child collection to another object    stackoverflow.com

I have a one-to-many relationship between Part and Params (a "Part" has many "Params). I'm trying to do something naive like this:

Part sourcePart = em.find(Part.class, partIdSource);
Part destPart = em.find(Part.class, partIdDest);

Collection<Param> paramListSource = ...

2. Using Eclipselink history policy with inheritance type join    stackoverflow.com

I would like to use eclipse link history to mirror the following to classes

@Entity
@Table(name="EMPLOYEE")
@Inheritance(strategy= InheritanceType.JOINED)
@TableGenerator(name="Employee_Gen", table="ID_GEN", pkColumnName="GEN_NAME", valueColumnName="GEN_VAL", pkColumnValue="Employee_Gen")
@Customizer(EmployeeCustomizer.class)
public class Employee implements Serializable {
}

@Entity
@Table(name="COMMESSIONEMPLOYEE")
public class CommesionEmployee extends Employee {
   ...

3. JPA with Map Collection    java.net

5. JPA/Topling Single Table Inheritance issue    java.net


@javax.persistence.Entity
@Table(name = "JCTERRITORYSET")
@Inheritance(strategy = javax.persistence.InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "generated", discriminatorType = DiscriminatorType.INTEGER, length = 1)
public abstract class TerritorySet implements Serializable {

@Id
@Column(name = "JCTERRITORYSETKEY", nullable = false)
private Integer territorySetKey;

@Column(name = "GENERATED", nullable = false)
private short generated;

@JoinColumn(name = "JCTERRITORYKEY", referencedColumnName = "JCTERRITORYKEY")
...

6. [JPA] Join with inheritance    java.net

7. Enumeration mapping JPA    java.net

In our database we have an enumeration of strings. All these strings are actually numbers, for example ['-2', '-1' ,'1' ,'2']. At first I wanted to create an enumerator in Java for this but I couldn't find out how to do it, since enumerated values cannot start with a number. Then I thought that I could use an int in my ...

8. JPA mapping file    java.net

9. JPA - ManyToMany deletes to much    java.net

On Nov 22, 2007 12:09 PM, wrote: > i have a temporary fix that first checks all the childs (recursively) > > public void deleteNodesWithMainId(@WebParam(name = "main_id") Integer mainId) { > deleteNode(em.find(Node.class, mainId)); > } > > private void deleteNode(Node n) { > Iterator it = n.getChildNodes().iterator(); > while(it.hasNext()) { > Node nChild = it.next(); > if(nChild.getParentNodes().size() == 1) > ...





10. Implementing Joined Inheritance in JPA    java.net

I'm not sure of the problem you are trying to solve, but there must be other acceptable ways (I hope). If one user using/modifying and existing parent object while another user wishes to turn it into a child object, how would you expect the object identity to be maintained? Parent entities cannot morph into child entity objects in java, so it ...

11. Another JPA problem with deleting a @ManyToMany relationship    java.net

I have code (probably seen here before) that has a ConfigurationSet and a ConfigurationBundle bidirectional @ManyToMany relationship. I am not using the cascade delete, but rather am removing the relationships manually and then deciding if I can remove an orphaned entity. Basically when I remove a ConfigurationSet, I disconnect the relationship with the ConfigurationBundles and then I check so see if ...

13. JPA map result query    java.net

I'm developing an application using netbeans and visual java Server faces. I did the job very well when tables have only a simple primary key but when it is a compose primary key I don't know how work with that. My database have 3 tables, master products(Articulos), master types(Tipos) and a listprices(listaprecios) I can only see data by this way

14. Accessing ids instead of objects in JPA @ManyToMany relationships    java.net

Hi, I'm in the process of converting an application from making direct SQL calls to using JPA. I have two tables, "games" and "players" that now have entity beans and a many-to-many relationship between them. In the database, there is a separate table "game_players" (containing the columns "game_id" and "player_id") that maintains the relationship, and is referenced by the @ManyToMany annotation. ...

15. Override module in glassfish/modules - Hibernate Validation    java.net

Hi guys I have encountered a bug in the Hibernate Validation version that is bundled with Glassfish 3. I am trying to deploy my application with a newer version (built from source), but Glassfish won't pick it up. I also tried putting the hibernate-validator.jar in glassfish/lib and domain1/lib, but no difference. It looks like the bundled bean-validator.jar in glassfish/modules is always ...

16. JPA 2.0 Persistent Map Problem    java.net

The language field of the map value is to be used as the map key. I absolutely want to avoid duplicating this in a redundant database table column. This is precisely what @MapKey is intended for, if I understand JSR 317 correctly, though there is a bit of vagueness whether or not the map value is allowed to be an embeddable ...