Duplicate model property at extended  java bean

Hello all!
I am using a java bean model. It contains classes which sometimes extend other classes.
After the import of java bean model, the model class has duplicate properties: one of the current class and one of the super class.
for example:
class Customer
field name
field moneySpent
class GoodCustomer extends Customer
field telephone
even though I do not overwrite the fields name/moneySpent the model class has 5 model relations:
name              --->relation name Customer.Name
name              --->relation name GoodCustomer.Name
moneySpent    --->relation name Customer.MoneySpent
moneySpent    --->relation name GoodCustomer.MoneySpent
telephone        --->relation name GoodCustomer.Telephone
In the bind context view I can also see the five properties, so I am confused which one to really bind to the context...
I would prefer the GoodCustomer relations, is that correct??
Cheers
stefan

Hi Geert,
I agree it is not very intuitive to have two model relations visible for the Inherited class.
One workaround is, incase you only need one relation of the two visible. Go to the
Model Editor of the Model Class by double clicking on the Model Class GoodCustomer. Go to the Relations tab and remove the relations
name --->relation name GoodCustomer.Name and
moneySpent --->relation name GoodCustomer.MoneySpent.
The Relations tab shows the origin of both the relations in the Target Role column within brackets. This will help you identify the unwanted relation and delete it.
However you can only delete relations from the sub class and not the super class.
I hope this helps.
Best Regards,
Nidhi Rajshree

Similar Messages

  • Java Bean Model in WebDynpro

    Hi,
    I have build am Java Bean Class which I use in a WebDynpro Model. In this Java Bean Class i want to call a remote method via RMI.
         public String calculate(int aFirst, int aSecond)
              float theResult = 0;
              try {
                   Properties p = new Properties();
                   p.put(Context.INITIAL_CONTEXT_FACTORY, "com.sap.engine.services.jndi.InitialContextFactoryImpl");
                   p.put(Context.PROVIDER_URL, "nitse06u:50004");
                   p.put(Context.SECURITY_PRINCIPAL, "Administrator");
                   p.put(Context.SECURITY_CREDENTIALS, "admin");
                   Context initialContext = new InitialContext(p);
                   Object ob = initialContext.lookup("Calculator");
                   CalculatorHome home = (CalculatorHome) PortableRemoteObject.narrow(ob, CalculatorHome.class);
                   Calculator theCalculator = home.create();
                   theResult = theCalculator.add(aFirst, aSecond);
              catch (Exception ex)
                   ex.printStackTrace();
              return new Integer(((new Float(theResult))).intValue()).toString();
    At runtime following exception occurred.
    java.lang.NoClassDefFoundError: com.sap.examples.calculator.CalculatorHome
         at com.sap.calculator.helper.CalculatorHelper.calculate(CalculatorHelper.java:109)
         at caom.sap.webdynpro.CalculatorComponentView.onActionCalculate(CalculatorComponentView.java:150)
         at caom.sap.webdynpro.wdp.InternalCalculatorComponentView.wdInvokeEventHandler(InternalCalculatorComponentView.java:144)
         at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)
         at com.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:67)
         at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.handleAction(WebDynproMainTask.java:100)
         at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.handleActionEvent(WebDynproMainTask.java:299)
         at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.execute(WebDynproMainTask.java:635)
         at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:59)
    How can I add the home and remote classes to my webdynpro?
    Regards 
    Richard

    You could try to put the ejbClient.jar (the jar file that was generated in your ejb project) into the lib directory of your webdynpro project.
    Everything in the lib directory is deployed with the Webdynpro application.
    To see the lib directory you have to change to the navigator view in the IDE.
    It is right under the Project root.
    If you have Development Component Projects this is a different story. You can add the public part in your ejb DC (of type assembly) to the DC usages in the WebDynpro DC. The type assembly means then, that the jar file from the ejb project is taken and packaged with the WebDynpro DC. But watch out. For this to work you have to do a real DC build and a real DC deploy not the deploy and run function. Hope this helps.

  • Java beans + jsp

    From a jsp I can use the setProperty property="*" method of java beans to set all the properties in a java bean, where each property has a corresponding element in the jsp page. How do I set the property of a java bean where I have the type of jsp code
    <%for (i=0;i<=15;i++)
    %>
    <input type="text" name="Text1" >
    <%
    %>
    I want to set the property of the javabean at one go.

    You need to have setter methods in the java bean corresponding
    to field names in the page. So, I don't think this can be done.

  • Best way to automatically map Java bean hierarchy to JavaFx property bean hierarchy

    We do not want JavaFx on the server side, so our DTO objects are plain Java beans.
    On the client side, we want to use the comfort of JavaFx bindings. As we're using Java 7, POJO bindings aren't possible yet.
    So we're looking for a way to automatically wrap the Java beans in JavaFx property beans.
    Possible approaches I've been looking into:
    - Code generation via JCodeModel
    - JavaBeanPropertyBuilder
    Ideally, we would want to have classes with structured JavaFx properties as a result, so that an ObjectProperty does not use the bean class, but always the respective JavaFx property bean class.
    This is so we don't need too many low-level bindings, but can rely on deep select bindings.
    This goes beyond the capabilities of JavaBeanPropertyBuilder as far as I understood it, so I'm left with fairly complex code generation using JCodeModel.
    Does anyone have some experience to share? Am I missing an option?

    Andipa wrote:
    As we're using Java 7, POJO bindings aren't possible yet.
    I'm sorry to reply without a good suggestion, but is there some type of POJO binding support in Java 8?
    This is what I currently use for POJO binding, but it doesn't sound very close to what you're asking for.  A lot of code still needs to be written by hand.  Also, I've only used it with relatively flat models so far.

  • Importing Java Bean Model in Webdynpro Development Component

    Hi All,
    Is there any simple tutorial, example  to import java bean model in webdynpro development component.
    I am using NWDS 7.0 SP14 and WAS 7.0.
    it really helps if you can  provide simple EJB as a development component with details how to create a public part and using this bean as java bean model in Webdynpro development component.
    what are the steps to be followed with precautions
    Thanks in Advance,
    Murali

    Hi,
    [Using the Java Bean Model in Web Dynpro|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/4072c0d0-c21e-2b10-ab84-e2c183d355de]
    [Using EJBs in Web Dynpro|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1f5f3366-0401-0010-d6b0-e85a49e93a5c]
    you will get more if you search in the forum.
    more help on EJB's
    Re: Help needed in EJB
    http://help.sap.com/saphelp_nw70/helpdata/EN/19/f9bc3d8af79633e10000000a11405a/frameset.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/70929198-0d36-2b10-04b8-84d90fa3df9c
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1f5f3366-0401-0010-d6b0-e85a49e93a5c
    PradeeP

  • Approach of Java Bean Model: What is the best way?

    Hi Experts,
    In our project, we are trying to connect Oracle Database and display the tables and information in it on Web Dynpro View.
    For this I'm following 4 step procedure broadly:
    1. Java DC: a) Create Class files --> one for connecting Database (JDBC Connectivity) ; other only having Input and Output variables with corresponding getter & setter methods ;and one more class file having all methods. I make Jar file out of this class files and store that within that DC project under _comp folder.
    2. Ext Lib DC: a) Copy the created Jar file in Library and make 2 public parts (one PP for compile time and other PP for assembly time).
    3. SAP J2EE DC: a) Create DC of type Library and above create PPs is added to this library.
    4. Web Dynpro DC: a) Add SAP J2EE DC of Library Type in my Used DCs. b) This will make the  JAR file created in Java DC to be available in options of " Jars from Pubilc Part" and  use all these class files as Models. And Using them we access the Oracle DB and get access to data.
    This proved to long exercise. I want to know if there is any other approach available other than this. I'm aware EJB Models approach, but this will be hit on my performance, so want to avoid this. Yet if any shorter approach is available.
    My Idea behind this long approach is from the SDN provided example on Java bean where in Web Dynpro Project uses a local jar file created from Java project which wraps a EJB Module project and Enterprise Application project. So in DC perspective if we have to include jar file we have to make it public part.
    <a href="/people/valery.silaev/blog/2005/09/14/a-bit-of-impractical-scripting-for-web-dynpro from Valery : A bit of (impractical) scripting for Web Dynpro</a> was in great help for making jar file exposed as Public part.
    I want opinions and suggestion on this regard and best available approaches.
    Thanks in advance
    Srikant

    D.V.,
    Here is an option to trun steps 1-4 into 1-2
    As far as you are using your Java classes only from WD DC-s, then:
    1. Put all your Java source in WD DC, create single public part for compilation. Bonus: you may create JavaBean model right here and add it to public part as well.
    2. In other WD DC-s refer public part created above and add run-time reference (via Project -> Properties) to corresponding DC. Now you can use both Java classes and JavaBean model.
    Valery Silaev
    SaM Solutions
    http://www.sam-solutions.net

  • Expose EJB through Java Bean model importer in Web Dynpro

    Hi,
    I am planning to expose EJB like following:
    1. Create Stateless session bean as a façade for DAO access.
    2. Create DAO to access database. In my case is Oracle DB
    3. Create Java Bean to encapsulate session bean
    4. Import java bean model to web dynpro
    Few of my business method return the object array e.g. Customer[] which contains all properties of customer, and getter, setter.
    Has anyone done this before? Is there any sample code?
    Best Regards,
    Zhang Yan

    Hi
    I think u can refer to the following link
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/java/simple java bean generator for database.pdf
    Thought this link is also Useful
    Creating and Deploying Web Services for an EJB
    Wishes
    Krishna kanth

  • Import Java Bean model in Web dynpro DC

    Hi all,
    I have created the following DC's on a track:
    1. EMPDic (Type: Dictionary) - DC that contains the database table.
    2. EMPEjb (Type J2EE) - DC that contains the EJBs that have business logic. Created a public part EMPpp that containd the bean classes.
    3. EMPEar (Type J2EE) - DC that contains the EMPEjb module.In Used Dcs added EMPpp
    4. EMPCmd (Type: Java) - DC that acts as the command bean.
    Created 2 public parts 'compile'(Type:compilation) and 'deploy' (Type:assembly). In Used DCs added EMPpp.
    5. EMPWd (Type: Webdynpro) - DC that will contain the Java Bean Model and the application. In Used DCs added 'compile' and 'deploy'.
    Q1.) Now when i try to import the Java bean model by selecting the radio button "public parts of used DCs" and look at the dropdown, i am not able to see any of the jar's related to my command bean DC.
    If i select the radio button "project(source folder)" and click Next it says 'No JavaBeans for import'. Am i missing something?
    Q2) Could someone tell me the exact steps from pt. 4 onwards. ie. whether it is necessary to create the 2 public parts for EMPCmd DC and what should it contain.
    Thanking you in advance.

    Hi Melwyn,
    check the NWDI tutorial, it will help you:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c0b53558-6df6-2910-cfbf-a63316bb0fad
    kind regards
    Stefanie

  • Calling Portal Service using result as Java Bean Model impossible?

    Hello folks,
    we try to achieve to call a portal service (working) which gives as a result a list of object of type com.foo.Report. We want to make use of this class as a model class, so we have the class as a model node in the context. The class itself is part of the service DC.
    Unfortunately at run time it gives us a NoClassDefFound Exception of com.foo.Report.
    As the com.foo.Report is part of the same DC as the service, it is no option to add the PAR public part to the used DCs of the WD DC because then there is this type conflict when we call the service (service look up). Or am I wrong and this is the way to do it? I mean I struggled quite a while to get the service look up right and needed to remove all the PAR/lib used DCs from the used DCs of the WD Project, when I got it working this Model error came up. I also tried to put the Model class in a separate DC but that caused the same error.
    how is it possible to call a Portal service from WD and using it's return vale as a Model class
    our system iis 7.0.17
    best
    Stefan

    Hi,
    Refers the following docs..
    EJBs in Web Dynpro Application Using Wrapper Class
    Here Java Bean Model used in web dynpro.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/00be903b-8551-2b10-c28a-8520400c6451
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1f5f3366-0401-0010-d6b0-e85a49e93a5c
    Accessing database table using EJB and web dynpro
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/70929198-0d36-2b10-04b8-84d90fa3df9c
    Oracle Connectivity with EJB using WebDynpro Application
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/wdjava/oracle%2bconnectivity%2bwith%2bejb%2busing%2bwebdynpro%2bapplication
    Hope it will help u.
    thanks
    Abhilasha

  • Possible to access bean property without Java Bean conventions?

    Hello,
    I'd like to show a component whenever there is an error message in the Faces context. Naively, I set the component's "rendered" attribute to the following:
    rendered="#{facesContext.messages.hasNext}"
    The object returned by facesContext.messages is an iterator, the properties of which do not follow Java Bean naming conventions. If there was a method called getHasNext() then all would be well. However as it stands, EL cannot evaluate this expression.
    I realise that wrapping this up in a managed bean would solve the problem, but I'd like to avoid this if I am able to do this directly from EL.
    Cheers,
    Chris

    Hi Juergen,
    hasNext actually returns a boolean which EL understands fine. In the end I just wrapped the call within a managed bean, as you suggested, and this works a treat:
      public boolean getHasMessages() {
        // hasNext will return true if there are any messages to be displayed
        return FacesContext.getCurrentInstance().getMessages().hasNext();
      }I suppose I felt compelled to post this entry since I found myself having to write some code for an expression that could be written perfectly well in EL but was limited only by the fact that EL can only access properties that follow the Java Bean convention.
    I thought that may have been some qualifier or method wrapper I could have used to mean 'take this property name literally'. Alas, it seems no such faclility exists.
    Thanks for taking the time to reply,
    Chris.

  • Importing java Bean Model

    hai ,
    am new to webdynpro for java ... Am trying to import ejb bean jar to web dynpro ..
    Steps as follows
    i) copy the bean jar to wd project lib folder
    ii) Set classpath
    SampleWD - > Model
    Model -> create model
    Model name  :  Samplemodel
    Model package : com.sample
    Local jar file : C:\sap\workspace\SampleWD\lib\addbean.jar -- getting error in this step as Invalid Class - java bean not available for import
    can anybody help me ..
    Thanks in advance...
    regards,
    Krish

    Hi Krish,
    In addition to Madhu's suggestion,
    As per the Java Bean Model creation steps, you will need to add the Commanad Bean JAR too in your Project, and while creation of Model, you need to select this Command Bean JAR and not the Bean Project JAR.
    Regards,
    Alka.

  • Importing Java Bean Model (Command Bean) with Session Bean

    Hello all,
    I'm trying to import a CommandBean as a Java Bean Model in WebDynpro but I'm prompted with an error indicating that I cannot import the EJB (Session Bean) DC that is being accessed by my CommandBean - hence failing to import the CommandBean DC as well.
    How do I import this?
    Help please.
    -Regards,
    Jan

    HI,
    just add ejb20.jar as an external jar in your WD project.

  • Simple Java Bean Model in Wed Dynpro

    Hello All,
    I have to develop a WD Java application with an Oracle DB as the backend. To application was designed to abstract the backend interaction into a Java bean model. The data connection and retrieval was successful. To move the data to the context following steps were performed:
    1. Create a java class with the variables to be used as context in the application. Ex: Name, Subject, Email
    2. On interting the ResultSet, set the values to the variables.
    But, only the last row of data is retained. We tried to use array but have not been able to move the ste of values to the context.
    Request your help in this regard to store the set of values into the context.
    Thank you.

    Hi,
    It looks like you are overwriting the same context element when populating it with the values from the resultset.
    Make sure you create every time a new context element and add it to the context root.
    while (rs.hasNext()) {
        ContextElement elem = new ContextElement();  // or something simular appropiate to your element
        elem.setName(rs.next().getName());
        contextRootNode.addElement(elem);
    Hope this helps a little.
    Regards,
    Alain

  • Complex Java Bean Model in WD

    I've revised the question.. to make it more simple.
    I have 2 wrapper classes, the first wrapper HAS the second wrapper as an object.
    When importing the Java Bean Model in WebDynpro, it seems okay - did the context binding, etc. -- until I did an "Apply Template" (as form) on the layout based on the CommandBean (which has the wrapper class).
    Now, the fields are not active fields.. I can't change the cardinality -- and I have played around with the relations of the model classes with each other.
    Nothing seems to work
    Please help.
    Edited by: Jan Michael Jaudian on Oct 8, 2008 8:07 AM

    problem solved.
    forgot to completely bind inner nodes.
    developers who need more info, do post here so I can help out in any way I can.
    Cheers!

  • How can I include Java Bean model into the model outside the component

    Hi All,
    I am new to SAP portal. I wanted to create a bean for storing the data and to include that into the application model.
    Please help me with an example .
    Regards,
    Saroj

    Hi,
      Check these blogs.
    The specified item was not found.
    Importing Complex JavaBean model into WebDynpro by creating relationships for the model classes
    JavaBean Model Import: when it really works
    Issue in Importing Java Bean Model
    Regards,
    Harini S
    Consider rewarding points for helpful answers. Post this thread in WD forums for more results.

Maybe you are looking for

  • How can I read channels from different SCXI modules simultaneu​sly?

    Hello. I have a system that consists in: - Three E-series DAQ boards (PCI-6034, PCI-6052 & PCI-MIO-16E) - One SCXI chassis (SCXI 1001) - 4 SCXI modules for voltage measurement connected to PCI MIO 16E - One SCXI module for strain gauges connected to

  • Can i export an excel file to my I-Cal & if so how?

    Hi.  I have a large amount of data/dates in an excel file and I would like to easily export these into my I-Cal. Please advise.

  • How do I see the time stamp from footage

    I was wondering if it is possible to see time stamps from footage taken by GoPro camera in FCPX. I can see the duration of the clips and the DATE it was created. I would like to see the actual time it was created. I have 2 cameras that were shooting

  • How to set password on email body in custom Email Template

    Hy, I have a Email Template customized in Email Definition>Design Console. I need send this 'Email Template' with the password user, but I don't know how to set the variable 'password' in the body of email. I searched in Varables>Targets>Variables, b

  • Retina support for any CS5 programs?

    I recently purchased a Macbook Pro with Retina display, and decided to install my copy of CS5.5 Design Standard. I have noticed that the UI has been scaled up to work with the retina screen so everything is fuzzy and pixelated. I am a student and use