Bidirectional relationships and JPA

Hi, all!
Consider the following class containing bidirectional relationship:
@Entity
public class Node {
private Node parent;
private Collection<Node> childNodes = new HashSet<Node>();
@ManyToOne(cascade = {CascadeType.PERSIST, CascadeType.REFRESH, CascadeType.MERGE})
public Node getParent() {
return parent;
public void setParent(final Node parent) {
this.parent = parent;
@OneToMany(fetch = FetchType.LAZY, mappedBy = "parent", cascade = {CascadeType.ALL})
public Collection<Node> getChildNodes() {
return childNodes;
public void setChildNodes(final Collection<Node> childNodes) {
this.childNodes = childNodes;
How should this bidirectional relationship be maintained?
Should I maintain synchronization between childNodes and parent programmatically like this:
public void setParent(final Node parent) {
if ( this.parent != parent ) {
this.parent = parent;
parent.addChild(this);
public void addChild(final Node child) {
if ( !childNodes.contains(child) ) {
childNodes.add(child);
child.setParent(this);
or can JPA provider (toplink essentials in J2SE environment) do it for me some way (may be some kind of weaving?).
What is the best practice for this?
Any help highly appreciated, thanks in advance!

In JPA you are responsible for maintaining bi-directional relationships in your own code, it is not part of the specification.

Similar Messages

  • A problem about bidirectional relationship recovery?

    I have read some snippets of AWT source. A snippet as following:
    ========================================
    * The parent of the object. It may be null for top-level components.
    * @see #getParent
    transient Container parent;
    ========================================
    java.awt.Component and java.awt.Container is a bidirection. But in Component source, the reference to Container is declared as "transient". That means the reference will not been included if the object is serialized. Right?
    If I transmit a Container object with some components to remote machine,how does the remote system recover the bidirectional relationship?

    A serialized Container recovers its "parenthood" by implementing the method void readObject(ObjectInputStream). If you look at the source you will find the lines:
    for(int i = 0; i < ncomponents; i++) {
      component.parent = this;

  • Maintaining Bidirectional Relationships

    Hi,
    Does someone know exactly what "Maintaining Bidirectional Relationships" means.
    I'm french and I still have some difficulties to understand properly some stuff.
    Then I'd like to understand what it is about.
    Thanks

    Vladislav,
    Bi-directional relationships are ones where two relationships in the model 1:1 or 1:M share the same FK relationship in the database.
    EXAMPLE: An Employee may have a collection of PhoneNumbers and each of those PhoneNumbers has a reference back to its Employee.
    By default developers must write their domain classes so that both sides of the relationship must be set when changing a relationship of this nature.
    When using Bi-directional relationships you would only have to modify one side and the other side would be modified automatically. In the example you would only add a PhoneNumber to an Employee's 1:M collection and the 1:1 back-reference would be automatically set.
    NOTE: Indirection is required on both directions and TransaprentIndirection is required on the 1:M.
    Doug

  • Drawback of 'Maintain Bidirectional Relationship'

    I recently came to this understanding which changes the way we are trying to use TopLink. I thought I'd share it in an attempt to spare others some of the difficulties we've had, and also to elicit any further clarifications or corrections as necessary.
    When you relate two domain objects with TopLink, the Mapping Workbench provides you with the option to Maintain Bidirectional Relationship. What this means is that, for example, if you have two classes Parent and Child, each with a relationship to each other, then all you have to do is call aParent.setChild(aChild) and you will also be able to retrieve the Parent object from the Child with a call to aChild.getParent(), even though you never explicitly called the Child object's setParent(Parent) method. TopLink updates the 'other end' of the relationship for you.
    This sounds like a wonderful feature. However, it does have its drawbacks. Let's say that the Child has another Parent, we'll call them ParentOne and ParentTwo. Together, these Parents make up the Child's logical primary key, and so you've mapped these attributes of the Child in TopLink as its primary key attributes. You've also told TopLink to Maintain Birdirectional Relationships between ParentOne.children and Child.parentOne and between ParentTwo.children and Child.parentTwo. Now you've got a particular Child, aChild, owned by Parent instances aParentOne and aParentTwo. You want the Child to be deleted, so you remove it from both of its Parent collections. When you do this, TopLink also removes the references to the Parent objects from aChild, and now you've just altered aChild's primary key. If you selected this Child from the database, TopLink no longer recognizes your instance as the one you selected, and now you're going to have a really hard time deleting it. When you commit your UnitOfWork, you are likely to see an exception that says 'cannot insert null' into one of the LPK fields, or even an OptimisticLockException, as now TopLink is thoroughly confused about what the heck you're doing.
    The moral is: Don't use Maintain Bidirectional Relationship on attributes that are part of a class' mapped primary key. And don't set that attribute to null if you want TopLink to continue to recognize the object. In the example above, something like the following would be appropriate:
    Child>>
    public void orphan(UnitOfWork uow) {
         boolean exists = uow.doesObjectExist(this);
         getParentOne().removeChild(this);
         getParentTwo().removeChild(this);
         if ( exists ) {
              uow.deleteObject(this);
         } else {
              uow.unregisterObject(this);
    }Yes, you need to explicitly delete or unregister the object, even if you marked it as Privately Owned by its Parents. The fact that I'm doing the existence check before removing the Child from its Parents is just an extra precaution to make sure I do the test before I do anything that might change the LPK. Although this is probably useless, since, if I do modify the PK, TopLink won't be able to find the object again anyway.

    I agree with John's conclusions and will be requesting enhancements to the mapping tools and documentation surrounding b-directional relationships involved in PKs.
    One thing I do want to make clear is the original intention of bi-directional relationship support. This was added initially to support EJB 2 relationships. It was also added to the core product for use in some POJO frameworks. It has its uses and does simplify model development but has its trade-offs in addition to what John has posted. It requires indirection in both relationships and the relationship maintenance is only managed when in the context of a TopLink session the objects are read from.
    I typically avoid using bi-directional relationship maintenance as the alternative solution of managing the relationships in the model are very straight forward. The result is typically better performing. Additionally, having a POJO model that is not dependent on the persistence manager allows this same model to be used in other contexts such as detachment through serialization.
    Also, EJB 3 does not currently have bi-directional relationship management within the specification.
    Doug

  • Bidirectional relationship vs IndirectMap

    Our class model have a bidirectional relationship managed by an IndirectMap and a ValueHolder. With TopLink 9.0.3 anything seemed to work well, but with TopLink 9.0.4 we get this error message as soon as we load the project mapping:
    Exception [TOPLINK-179] (OracleAS TopLink - 10g (9.0.4) (Build 031126)): oracle.toplink.exceptions.DescriptorException
    Exception Description: The attribute, [MyAttributeName] uses Bidirectional Relationship Maintenance, but has ContainerPolicy, [MapContainerPolicy(class oracle.toplink.indirection.IndirectMap)] which does not support it. The attribute should be mapped with a different collection type.
    Mapping: oracle.toplink.mappings.OneToManyMapping[MyAttributeName]
    Descriptor: Descriptor(MyClassName --> [DatabaseTable(MyTableName)])
    Is there a way to enable bidirectional relationship with an indirect map?
    Thanks, Yannick

    I'd open a TAR, if it worked in 903 and not 904... 9041 patch was just release on Metalink, Patch "3443153", but I don't see anything in there related to this. Might be worth a shot.
    - Don

  • The relationships and links between the various SAP database tables

    Hi Gurus,
    I am trying to learn the relationships and links between the various SAP database tables (SAP FI-AA, SAP SD, SAP MM, SAP HR and so on) for correctly extracting data from them. Especially I am expressing an interest in the SAP database tables on SAP FI-AA, SAP SD, SAP MM, SAP HR. Could somebody provide me with documentations about the relationships and links between them. I will be very grateful if somebody can provide me with links.
    Thanks and regards
    Sergey

    hi Sergey,
    try
    http://www.erpgenie.com/abap/tables.htm
    http://www.erpgenie.com/abap/tables_fi.htm
    http://abap4.tripod.com/SAP_Tables.html
    http://abap4.tripod.com/Finance_Tables.html
    http://www.auditware.co.uk/SAP/Extras/SAPTables.pdf
    hope this helps.

  • Clarify ADF BC and JPA

    I am a Forms programmer, want to start learning Jdeveloper and java. I read many books and 11g tutorals. I am confused that are there 2 different methods in create database entities?
    1. I want to clarify that ADF BC and JPA are 2 different things, is it?
    2. if yes, which one is simple and easy to handle?
    Thanks a lot !

    ADF bc is simple and easy and has lot of features.
    And most of all, ADF bc is vastly used in Oracle Applications ERP V1.
    Features of ADF bc can be easily compared with forms world. like datablock to EO, LOVs etc
    --Prasanna                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to use remote managed bean and JPA in JSF

    Hi All,
    I am familiar with referencing backing-beans and JPA properties where Glassfish and MySQL is running locally. However, is it possible to lookup these same properties using JNDI if they reside on remote servers? If so, what change is needed?
    I would like to distribute the J2EE 5 application load including database by running Glassfish, MySQL on separate servers. This will put on the JSF (presentation-tier) components on it's own server while a secondary system will handle the middle tier processing and leaving the database activities to be carried out on another server. Not sure whether this is the right approach though. These hardware would run on both Solaris and Windows platforms.
    Unfortunately, buying faster hardware is not an option.
    Any assistance would be appreciated,
    Jack

    Hi Faissal,
    Is your suggestion below:
    //Lookup an EJB and use it
       YourRemoteBean bean = (YourRemoteBean ) ServiceLocator.findRemoteObject(jndiName); // ServiceLocator is a class that lookup
                                                                                                                                           //  the remote objectis equivalent to the following lines:
    Properties props = new Properties();
        props.setProperty("java.naming.factory.initial", "com.sun.enterprise.naming.SerialInitContextFactory");
                props.setProperty("java.naming.factory.url.pkgs", "com.sun.enterprise.naming");
                props.setProperty("java.naming.factory.state", "com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");
                // optional.  Defaults to localhost.  Only needed if web server is running
                // on a different host than the appserver   
                // props.setProperty("org.omg.CORBA.ORBInitialHost", "localhost");
                props.setProperty("org.omg.CORBA.ORBInitialHost", "remoteServer");
                // optional.  Defaults to 3700.  Only needed if target orb port is not 3700.
                // props.setProperty("org.omg.CORBA.ORBInitialPort", "3700");
                InitialContext jndiContext = new InitialContext(props);     
                InitialContext jndiContext = new InitialContext();
                YourRemoteBean bean =  (YourRemoteBean) jndiContext.lookup("ejb.YourRemoteBean");Thanks,
    Jack

  • BP Relationship and Org is not matching

    Hi Gurus,
    I have a issue where in BP relationship for a user a different org is appearing than in org. structure.
    USER A---- Org A (in BP)
    USER A----- Org B(In org Structure)
    I have tried reparing in users-gen but no use.
    Can any one help.
    IS

    Hi,
    I do not know which acenario you're talking about (BP integration on ERP, CRM SRM?), but in general the following procedure will work for all scenarios:
    if you encounter an inconsistency between the org. assignment in organizational management and the relatedbusiness partner relationship (and only one relationship exist) you may reassign the employee (or assigned position) to the org. unit which the business partner (BP) shown in table BUT050 is related to (you have to use the same period as shown in BUT050) and save.
    Afterwards you reassign to the former org. unit again and save again.
    Precondition is to be on a recent support package level of component SAP_ABA; available corrections are linked to note 550055 and 934372.
    Regards,
    Michael

  • Bidirectional relationshps and circular graphs

    Hi,
    We are currently using the POF serialization with Coherence 3.7.0.2 but are running into infinite loops when serializing circular graphs or bidirectional relationships. Any recommendations?
    Thank you,
    Horea

    It appears that this is supported only via the PofSerializer interface not via the PortableObject interface. We are using the latter.

  • Difference between pool pair relationship and Backup registrar configuration

    Hi,
    I would like to difference between pool pair relationship and Backup registrar configuration?
    Are both concepts are reffering same for DR site resiliency in Lync 2013?
    Thanks

    Backup Registrar works the same in Lync 2013 as it did in Lync 2010. This allows for registration in the event the primary registrar is unavailable. Pool Pairing is built on top of the Backup Registrar functionality.
    Take a look at the following:
    Backup Registrar Functionality in Lync Server 2013: http://blogs.technet.com/b/dodeitte/archive/2012/08/08/backup-registrar-functionality-in-lync-server-2013.aspx
    Lync Paired Pools - Why it Matters: http://blogs.perficient.com/microsoft/2012/12/paired-pools-why-it-matters/
    Backup Registrar relationships in Lync Server 2013: http://technet.microsoft.com/en-us/library/jj205033.aspx
    Please mark posts as answers/helpful if it answers your question.
    Blog
    Lync Validator - Used to assist in the validation and documentation of Lync Server 2013.

  • Register Relationships and Device Grouping

    Hi All,
    Can anyone provide me some documentation on Register Relationships and Device Grouping in IS-Device Management and the respective use of the same.
    Use means I mean: on which business cases we are going for register relationships and device grouping and the needed configuration needed to be done.

    Hi Niladri,
    Please go through the below link
    http://help.sap.com/saphelp_rc10/helpdata/en/9c/862f9c10df11d285250000e8200ef0/frameset.htm
    If you still face any problem do let us know.
    Regards,
    S

  • JPA one to many relationship and serialization

    Hi,
    I modeled a one to may relationship like this:
    Parent Class WFData:
    @OneToMany(mappedBy = "wfData", targetEntity = Positionen.class)
    private Set<Positionen> positionen;
    Child Class Positionen
    @ManyToOne
    @JoinColumn(name = "WF_REF_ID", referencedColumnName = "ID")
    private WFData wfData;
    Now I want to create an EJB session bean with a method which returns an object of type WFData (parent) published as web service . When I try to deploy the web service I get the following error message: Unable to generate serialization framework for web service
    Does anyone know how to serialize a one-to-many relationship so I can use these objects in a web service?
    Best regards,
    Kevin

    I found the solution to get serialization correctly working and enable the service to be used in Visual Composer.
    You need to add the tag @XmlTransient to the getter method of the attribute in the child class that references the parent.
    @XmlTransient
    public WFData getWfData() {
        return wfData;

  • Recursive Parent Child relationship in JPA

    @Entity
    @Table(name = "OBJECTCATEGORY")
    public class ObjectCategory implements Serializable {
         @Id
         private String categoryId;
         private String categoryName;
         private String description;
         private static final long serialVersionUID = 1L;
         @ManyToMany(fetch = FetchType.EAGER)
         @JoinTable(name = "MAP_CATEGORY", joinColumns = @JoinColumn(name = "CATEGORYID"), inverseJoinColumns = @JoinColumn(name = "OBJECTID"))
         private List<MapC> mapList = new ArrayList<MapC>();
    // Recursion
         @OneToMany(fetch = FetchType.LAZY, mappedBy = "fqQuesCatagory")
         List<ObjectCategory > categoryList = new ArrayList<ObjectCategory>();
         @ManyToOne
         @JoinColumn(name = "PARENTCATEGORY")
         private ObjectCategory fqQuesCatagory
    // Recursion
         public FqQuesCatagory() {
              super();
         public String getCategoryname() {
              return this.categoryname;
         public void setCategoryname(String categoryname) {
              this.categoryname = categoryname;
         public String getDescription() {
              return this.description;
         public void setDescription(String description) {
              this.description = description;
         public List<MapC> getMapList() {
              return faqList;
         public void setFaqList(List<MapC> faqList) {
              this.mapList = mapList ;
         public String getCategoryid() {
              return categoryId;
         public void setCategoryid(String categoryid) {
              this.categoryid = categoryId;
         public List<ObjectCategory> getFqCategoryList() {
              return categoryList;
         public void setFqCategoryList(List<ObjectCategory> categoryList) {
              this.categoryList = categoryList;
         public ObjectCategory getFqQuesCatagory() {
              return fqQuesCatagory;
         public void setFqQuesCatagory(ObjectCategory fqQuesCatagory) {
              this.fqQuesCatagory = fqQuesCatagory;
    Doesn't SAP JPA support recursive parent-child relationship (highlighted by "// Recursion"). The same model works in TopLink perfectly.

    Sorry for the delayed update..
    I see an issue in the WSNavigator. I have a method in my EJB exposed as a web service. This method has a single argument, which is a serializable class containing a few string variables and the above-mentioned Entity with suitable getters and setters for all the class variables.
    When I try to select this operation under the WSDL in the Webservice Navigator, I get a stack overflow error. I think it is because WD4J run-time is not able to build the nested tree. Not sure though...I've attached the stack trace below:
    Cannot send an HTTP error response [500 "Application error occurred during the request procession." (details: java.lang.StackOverflowError
    at java.lang.String.lastIndexOf(String.java:1496)
    at java.lang.String.lastIndexOf(String.java:1458)
    at com.sap.dictionary.runtime.StringUtil.getPackageName(StringUtil.java:143)
    at com.sap.dictionary.runtime.DdBroker.getDataType(DdBroker.java:179)
    at com.sap.tc.webdynpro.progmodel.context.DictionaryHandler._getScalarType(DictionaryHandler.java:447)
    at com.sap.tc.webdynpro.progmodel.context.DictionaryHandler.getDataType(DictionaryHandler.java:159)
    at com.sap.tc.webdynpro.progmodel.context.DataAttributeInfo.init(DataAttributeInfo.java:447)
    at com.sap.tc.webdynpro.progmodel.context.NodeInfo.addAttribute(NodeInfo.java:746)
    at com.sap.tc.webdynpro.progmodel.context.NodeInfo.addAttribute(NodeInfo.java:759)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder.createParameterNodeInfo(DWSContextBuilder.java:984)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder.access$400(DWSContextBuilder.java:88)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.buildContextForComplexType(DWSContextBuilder.java:1591)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.buildContextForTypeObject(DWSContextBuilder.java:1574)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.createElementObject(DWSContextBuilder.java:1763)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.createFieldObject(DWSContextBuilder.java:1681)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.intWithStructureFields(DWSContextBuilder.java:1671)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.createComplexTypeObject(DWSContextBuilder.java:1660)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.buildContextForComplexType(DWSContextBuilder.java:1615)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.buildContextForTypeObject(DWSContextBuilder.java:1574)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.createElementObject(DWSContextBuilder.java:1763)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.createFieldObject(DWSContextBuilder.java:1681)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.intWithStructureFields(DWSContextBuilder.java:1671)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.createComplexTypeObject(DWSContextBuilder.java:1660)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.buildContextForComplexType(DWSContextBuilder.java:1615)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.buildContextForTypeObject(DWSContextBuilder.java:1574)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.createElementObject(DWSContextBuilder.java:1763)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.createFieldObject(DWSContextBuilder.java:1681)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.intWithStructureFields(DWSContextBuilder.java:1671)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.createComplexTypeObject(DWSContextBuilder.java:1660)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.buildContextForComplexType(DWSContextBuilder.java:1615)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.buildContextForTypeObject(DWSContextBuilder.java:1574)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.createElementObject(DWSContextBuilder.java:1763)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.createFieldObject(DWSContextBuilder.java:1681)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.intWithStructureFields(DWSContextBuilder.java:1671)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.createComplexTypeObject(DWSContextBuilder.java:1660)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.buildContextForComplexType(DWSContextBuilder.java:1615)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.buildContextForTypeObject(DWSContextBuilder.java:1574)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.createElementObject(DWSContextBuilder.java:1763)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.createFieldObject(DWSContextBuilder.java:1681)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.intWithStructureFields(DWSContextBuilder.java:1671)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.createComplexTypeObject(DWSContextBuilder.java:1660)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.buildContextForComplexType(DWSContextBuilder.java:1615)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.buildContextForTypeObject(DWSContextBuilder.java:1574)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.createElementObject(DWSContextBuilder.java:1763)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.createFieldObject(DWSContextBuilder.java:1681)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.intWithStructureFields(DWSContextBuilder.java:1671)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.createComplexTypeObject(DWSContextBuilder.java:1660)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.buildContextForComplexType(DWSContextBuilder.java:1615)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.buildContextForTypeObject(DWSContextBuilder.java:1574)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.createElementObject(DWSContextBuilder.java:1763)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.createFieldObject(DWSContextBuilder.java:1681)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.intWithStructureFields(DWSContextBuilder.java:1671)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.createComplexTypeObject(DWSContextBuilder.java:1660)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.buildContextForComplexType(DWSContextBuilder.java:1615)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.buildContextForTypeObject(DWSContextBuilder.java:1574)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.createElementObject(DWSContextBuilder.java:1763)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.createFieldObject(DWSContextBuilder.java:1681)
    at com.sap.esi.esp.wsnavigator.helper.DWSContextBuilder$DInputParams.intWithStructureFields(DWSContextBuilder.java:1671)
    Any thoughts on this will be highly appreciated.
    BR.

  • One to one relationship in jpa

    I have two relation table like , I would Like to try select by UID by JPA ,
    select *from student as P, Address as A where P.UserId=A.UserId
    and A.UpdateId=uid;
    step one
    I have my persistence.xml testing by single table
    step two I have two entity class from DB
    in my student{} @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Basic(optional = false)
    @Column(name = "UserId", nullable = false)
    private Integer userId;.....
    in my address I have
    @JoinColumn(name = "UserId", referencedColumnName = "UserId", nullable = false)
    @OneToOne(cascade=CascadeType.ALL, mappedBy="Student")
    private Student student;
    what else I need to do in order to let it work??

    jsutherl wrote:
    To do a join in JPA you can either use "join" or the "." notation for a OneToOne.
    i.e.
    Select s from Student s where s.address.updateId = :id
    You would need a OneToOne from Student to Address for this.
    @OneToOne(mappedBy="student")
    private Address address;
    James : http://www.eclipselink.org
    I guest I get the part that you post , but if I want to display the information out of two tables, but in Servlet
    Query query=em.createNamedQuery("?");
    List stList=query.getResultList();
    Iterator stIterator=stList.iterator();
    while(stIterator.hasNext()){
    *? which class?*=?.stIterator.next();} ??
    Thank you!

Maybe you are looking for

  • User-defined object problem,why can't I use?

    as follows: UObject.java package test1; public class UObject private String num; public UObject() public void setNum(String num) this.num=num;      public String getNum() return num;      Test.java package test1; public class Test public static void

  • My ipod 4th gen won't update to the new one with imessage and all that.

    I got my ipod touch in march 2011. So its not ios 5. But everytime i plug it in this is what happens step by step. 1. Itunes comes up like usual and asks me if i want to updated my ipod to 5.0.1. 2. The tag your pictures come up. 3.I tag the pitures

  • Installing Solaris 10 on X2100 with 1TB drive

    I am trying to install the latest Solaris 10 (X86) on an Sun X2100. The installation fires up fine until it tries to set up the hard drive and then it fails with the following error message: FILE SYSTEM CREATION FAILED COULD NOT CHECK OR CREATRE SYST

  • Populating bank details in Idoc basic type PEXR2002 message type PAYEXT

    Hi, I need to populate the bank details in E1IDBO2 I2. however, this segment appears on the idoc  if i use RVND free form payment and release it. This is not happening if i use FB60. i couldn't see the E1IDBO2 I2 segment at all. Is there any setting

  • How to create new JNDI Data source in Tomcat 5.0 server

    hi ... I have created new datasource but its giving an error like ERROR: org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null', cause: null Nested Exception: java.lang.NullPointerException please can