2 TopLink Java Object from Table to be used in single selectOneChoice

Hello everyone, can I ask for help on how to solve my problem....
Here's my scenario, I have 2 tables namely tblCollege and tblCourse, they are related through tblCourse.CollegeCode = tblCollege.Code.
I use the jdeveloper wizard using TopLink -> Java Object from Table to add these table to my project. I created an EJB Data Control so that I can use them to my Userinterface using ADF Faces.
What I really want to do is that I need to have selectOneChoice component displaying:
tblCollege.Name + tblCourse.Name, and it should have a value of tblCollege.Code + tblCourse.Code,
so for example in my
tblCollege:
Code---------Name
1---------------Science
2---------------Music
tblCourse
Code-------Name-----------CollegeCode
1-------------Biology----------1
2-------------Computer-------1
3-------------Guitar------------2
what I want in my selectOneChoice is like this:
value----------display
1-1--------------Science-Biology
1-2--------------Science-Computer
2-3--------------Music-Guitar
I'm a little stuck on how I'm going to that. Thanks.

Bawasi,
I see a couple of angles of attack, but this really depends on the technologies involved. If you are using ADF Bindings in combination with ADF Faces then you need to shape the data at the entity level. If ADF Bindings are no the in equation, you can take a less aggressive approach and shape the data in a managed bean. What is not clear to me is the end-to-end use-case. I see the read-only (i.e. how to get data to the drop box), but I am
not certain what attribute on an entity you are attempting to set. Are you trying to set the course for the current user or for a master schedule? Finally, notice that the final shape of your data set shows a unique combinations, you could increase the performance of your use-case and ease of development simply by denormalizing your schema.
--RiC                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

Similar Messages

  • SRDemo tutorial- Reverse engineer TopLink Java Objects from existing DB tab

    Hi,
    In the tutorial, what does reverse engineer objects from existing tables means?
    Thanks!

    It means that JDeveloper will create Java classes that interact with the database, based on existing tables in the database.

  • Which is better ? Toplink Java objects or Toplink Entities ?

    Hi
    We are planing to use Toplink JPA that comes with JDeveloper 11g preview release
    I have a question here!
    I would like to get clarified which is better to use :
    1. Toplink Java Objects from Tables ,
    2.Toplink Entities from Tables
    Could you suggest the best approach, and pros and cons of both the approaches?
    Thanking you ,
    Samba

    Samba,
    Ultimately both are using the same TopLink runtime. In the case of Entities you are using JPA and Java Objects you are using TopLink native API and metadata.
    Going forward I would recommend JPA with TopLink extensions as required.
    Doug

  • Oracle JDeveloper 10.1.3 Toplink Objects from Table Bug.

    i try this with updates and without them.
    toplink bug or toplink Wizzard Bug: I have create a conection to data base(MySQL) I use mysql-connector and everything works... i see the tables then i try to create "TOplink objects from Table " , choose connection ,for Schema i choose "none". When i choose AutoQuerry it shows the columns i add columns , I choose OK. When it ask for a name for the package i give him mypackage, when it ask for class name i also choose my package.Users(the table is Users) after which i have the following exception in MessageBox:
    "oracle.jdeveloper.cm.ds.db.InvalidNameException : Object must have a name."
    on details i get :
    oracle.toplink.addin.mappingcreation.MWProjectCreationException: oracle.jdeveloper.cm.ds.db.InvalidNameException: Object must have a name.
         at oracle.toplink.addin.mappingcreation.MappingCreatorImpl.generateMappedDescriptorsForTables(MappingCreatorImpl.java:277)
         at oracle.toplink.addin.mappingcreation.MappingCreatorImpl.generateMappedDescriptorsForTables(MappingCreatorImpl.java:196)
         at oracle.toplink.addin.wizard.jobgeneration.JobWizard$1.construct(JobWizard.java:416)
         at oracle.ide.util.SwingWorker$1.run(SwingWorker.java:119)
         at java.lang.Thread.run(Thread.java:595)
    Caused by: oracle.jdeveloper.cm.ds.db.InvalidNameException: Object must have a name.
         at oracle.jdeveloper.cm.ds.db.validators.AbstractValidator.validateName(AbstractValidator.java:54)
         at oracle.jdeveloper.offlinedb.validators.OfflineSchemaValidator.validateName(OfflineSchemaValidator.java:29)
         at oracle.jdeveloper.cm.ds.db.validators.AbstractValidator.validateObject(AbstractValidator.java:187)
         at oracle.jdeveloper.cm.ds.db.validators.AbstractValidator.validateObject(AbstractValidator.java:122)
         at oracle.jdeveloper.cm.ds.db.AbstractDBObjectProvider.validateObject(AbstractDBObjectProvider.java:822)
         at oracle.jdeveloper.cm.ds.db.AbstractDBObjectProvider.validateSchema(AbstractDBObjectProvider.java:858)
         at oracle.jdeveloper.offlinedb.OfflineDBObjectProvider.createSchema(OfflineDBObjectProvider.java:1954)
         at oracle.toplink.addin.mappingcreation.MappingCreatorImpl.updateOfflineDBandMWDatabaseWithTablesToMap(MappingCreatorImpl.java:450)
         at oracle.toplink.addin.mappingcreation.MappingCreatorImpl.generateMappedDescriptorsForTables(MappingCreatorImpl.java:242)
         ... 4 more
    in the messege log i get :
    Starting Java object generation...
    Creating offline database objects...
    A problem was encountered creating offline database objects.
    Aborted Java object generation.
    Message was edited by:
    JOKe
    Message was edited by:
    JOKe

    I have tried this out in the EA release of JDev, and have reproduced the problem you reported. However, trying out the latest development build, the problem does not occur, so this bug has been fixed. You'll pick up this fix when we next release the software on OTN.

  • Storage of Java object in table column

    Hello,
    We have developed an application that requires some Java objects to be stored in tables.
    With JDataStore, Cloudscape or InstantDB the operation is rather straightforward. We can use something like:
    pstmt = conn.prepareStatement("INSERT INTO TABLEOBJ(ID,OBJ) VALUES (?,?)");
    pstmt.setLong(1,i);
    pstmt.setObject(2,myObject);
    psmt.executeUpdate();
    Some of our clients would like us to use Oracle Lite rather than any of the previously mentioned databases. The only problem is that the above simple code does not work with Oracle.
    What is then the easiest way to save Java Object in table column?
    Thanks in advance,
    Benoit Marchal

    found part of the answer in another newsgroup.
    But is Oracle Lite 4.0 offering the same possibility? Is it going to be implemented in Oracle Lite 5.0?
    Benoit
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Alexander Day ([email protected]):
    Another little tidbit from ORacle's documentation:
    "Important: The JDBC 2.0 specification states that PreparedStatement methods setBinaryStream() and setObject() can be used to input a stream value as a BLOB, and
    that the PreparedStatement methods setAsciiStream(), setUnicodeStream(), setCharacterStream(), and setObject() can be used to input a stream value as a CLOB. This
    bypasses the LOB locator, going directly to the LOB data itself. In the implementation of the Oracle JDBC drivers, this functionality is supported only for a configuration using an 8.1.6 database and
    8.1.6 JDBC OCI driver. Do not use this functionality for any other configuration, as data corruption may result."<HR></BLOCKQUOTE>
    null

  • Dropping java object from Oracle 8i

    We areaable to load java methods and publish them to SQL in Oracle 8i using Jdev Deploy wizard, but we can not drop them thru
    Open View As->Database Browser of the connection object, they drop menu is greyed out/disable. What kind privilege we need to drop java object from Oracle 8i? Or there is something wrong with the database setup.
    Thank you very much

    There are three options:
    Normal
    SysDBA
    SysOper
    I have tried the three of them, none of them works, is there third option SYS?
    Thank you very much.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Amit:
    Log in as SYS.<HR></BLOCKQUOTE>
    null

  • Accessing java objects from within javascript

    Hello,
    Anyone with an idea of a useful toolkit for accessing java objects from within javascript will be much appreciated.
    Thanks in advance,
    Antana.

    What do you mean by accessing Java objects? Do you mean interacting with an applet via JavaScript? Something else?

  • How can i return an object isn't java object from webservice????

    Hi !
    I have a problem in my Project. When i call method return a java object from webservice , it 's too easy. But when i create my own object (ex:ClientRequest.class) , it doesn't work exactly T_T . When i return that object (on client, doesn't have ClientRequest.class) , i cann't access its static variables.
    How can i do it ??
    Please help me !
    Thanks a lot !!!!!
    class ClientRequest {
    public static int i;
    public static String s;
    public ClientRequest() {
    }

    You can use REFCURSOR type for this. In java SQL TYPES this is available too. In your PLSQL use REFCURSOR for that array and then take the same from java code. Look in the servelet programming book for this SQLTYPE and see PLSQL for handling refcursors. We have done this way and it works.

  • Access Java object from Javascript

    Hi
    I'm trying to invoke a Java object from Javascript (scriptengine and all that).
    I want to add scripting features to a GeneXus Java generated app... and I have very basic skills on java too. Sorry for that ;o).
    This is the java code to pass "params" to the scriptengine:
    engine.put("remoteHandle",remoteHandle);
    engine.put("context", context); The remoteHandle (int) and context (com.genexus.ModelContext) pass trough all the gx-java generated programs.
    This javascript works fine:
    importClass(Packages.uftestjs);
    new uftestjs(remoteHandle).execute( ) ;The remoteHandle conversion is ok (javascript-number to int). The context is optional.
    But if I want to pass context:
    importClass(Packages.uftestjs);
    new uftestjs(remoteHandle, context).execute( ) ;Fails with this:
    "javax.script.ScriptException: sun.org.mozilla.javascript.internal.EvaluatorException: Java constructor for 'uftestjs' with arguments 'number,javax.script.SimpleScriptContext' not found."
    Obviously, no conversion is possible with context (javax.script.SimpleScriptContext to com.genexus.ModelContext).
    There is some way to reference de original context, by the object Id??? or something like that???
    Thanks in advance for any replies!!!
    Greetings from Chile. (I hope you can understand my english!)

    Hi
    Well, since this topic is about java programming I think the place is right here.
    (I use some tricks to embed java statements in genexus objects...)
    I will try to get some help at Artech (GX) on how to build something... to get the conversion needed.
    But they are not focussed on support this kind of questions.
    Anyway, I want to know: do I can to reference an object by the objId?
    I want to code something like this:
    com.genexus.ModelContext context =
                     (com.genexus.ModelContex)getTheObjectFromTheJVM(theObjectId);(powered by google translator, ha!)

  • How to reference multiple instances of the same Java object from PL/SQL?

    Dear all,
    I'm experimenting with calling Java from PL/SQL.
    My simple attempts work, which is calling public static [java] methods through PL/SQL wrappers from SQL (and PL/SQL). (See my example code below).
    However it is the limitation of the public static methods that puzzels me.
    I would like to do the following:
    - from PL/SQL (in essence it needs to become a forms app) create one or more objects in the java realm
    - from PL/SQL alter properties of a java object
    - from PL/SQL call methods on a java object
    However I fail to see how I can create multiple instances of an object and reference one particular object in the java realm through public static methods.
    My current solution is the singleton pattern: of said java object I have only 1 copy, so I do not need to know a reference to it.
    I can just assume that there will only ever be 1 of said object.
    But I should be able to make more then 1 instance of an object.
    To make it more specific:
    - suppose I have the object car in the java realm
    - from PL/SQL I want to create a car in the java realm
    - from PL/SQL I need to give it license plates
    - I need to start the engine of a scpecific car
    However if I want more then 1 car then I need to be able to refrence them. How is this done?
    Somehow I need to be able to execute the following in PL/SQL:
    DECLARE
    vMyCar_Porsche CAR;
    vMyCar_Fiat CAR;
    BEGIN
    vMyCar_Porsche = new CAR();
    vMyCar_Fiat = new CAR();
    vMyCar_Porsche.setLicensePlates('FAST');
    vMyCar_Porsche.startEngine();
    vMyCar_Fiat.killEngine();
    END;
    Thanks in advance.
    Best Regards,
    Ruben
    My current example code is the following:
    JAVA:
    ===
    CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED CODAROUL."RMG/BO/RMG_OBJECT" as package RMG.BO;
    public class RMG_OBJECT {
    private static RMG_OBJECT instance = new RMGOBJECT();
    private String rmgObjectNaam;
    private RMG_OBJECT(){
    this.rmgObjectNaam = "NonDetermined";
    public static String GET_RMGOBJECT_NAAM () {
    String toestand = null;
    if (_instance == null) {toestand = "DOES NOT EXIST";} else { toestand = "EXISTS";};
    System.out.println("instance : " + toestand);
    System.out.println("object name is : " + _instance.rmgObjectNaam);
    return _instance.rmgObjectNaam;
    public static Integer SET_RMGOBJECT_NAAM (String IN)
    try
    _instance.rmgObjectNaam = IN;
    return 1;
    catch (Exception e)//catch
    System.out.println("Other Exception: " + e.toString());
    e.printStackTrace();
    return 5;
    } //catch
    PL/SQL Wrapper:
    ==========
    CREATE OR REPLACE FUNCTION CODAROUL.SET_RMGOBJECT_NAAM(NAAM IN VARCHAR2) return NUMBER AS
    LANGUAGE JAVA NAME 'RMG.BO.RMG_OBJECT.SET_RMGOBJECT_NAAM (java.lang.String) return java.lang.Integer';
    Calling from SQL:
    ==========
    CALL dbms_java.set_output(2000);
    select CODAROUL.GET_RMGOBJECT_NAAM() from dual;
    Edited by: RubenS_BE on Apr 6, 2012 5:35 AM
    Edited by: 925945 on Apr 6, 2012 5:41 AM

    You can do this by manually creating a new iterator binding in your binding tab.
    So instead of dragging the VO directly to the page, go to the binding tab, add a new executable iterator binding, and point to that one from your ELs in the page itself.

  • How can I drop the java objects from a schema

    hi..good afternoon all...
    How can I drop the java objects from a database schema???
    suppose the credentials are scott/tiger@db1
    Another thing is that...I have to do this from cmd(command prompt) as there is no plsql developer or sqldeveloper installed in the machine.
    plss help...thanks in advance...

    hi...i have already tried all the options..but it is showing the error..
    ora:01435 - user does not exist
    but when i have given the command...
    select object type, object_name, status from user_objects where object_type like'%JAVA%';
    then it is showing that the java_object is present....
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL>
    SQL>
    SQL>
    SQL> set linesize 200
    SQL>
    SQL>
    SQL>
    SQL> select object_type, object_name, status from user_objects where object_type
    like '%JAVA%';
    OBJECT_TYPE OBJECT_NAME
    STATUS
    JAVA CLASS javaclass1
    VALID
    JAVA SOURCE javaclass1
    VALID
    SQL> drop java source javaclass1.java;
    drop java source javaclass1.java
    ERROR at line 1:
    ORA-01435: user does not exist
    SQL>

  • A way to find as to a variable from table TAVRV is used in which program?

    Hello Experts,
    Is there a way to find as to a variable from table TAVRV is used in which of the variants and in what programs. Example: can we find a variable ZZ_AAAA_ACTUEL (from table TVARV) is used in which variants / programs?
    I want maintain one variable and i will be sure that not affect others programs.
    Regards.

    Hi Salhi
    open your table in SE11 and click on that variable, then there is a option 'where used list' in your application tool bar
    click on that option, it will give you a small pop up window from where you can select in which options you want to search for that variable.
    i hope this will work for you
    Thanks
    lalit Gupta

  • 32-bit JVM receiving Java objects from 64-bit JVM

    Hi folks,
    Question is: will there be problems for 32-bit JVM receiving Java objects from 64-bit JVM? and vice versa.
    Our application client is running on 32-bit JVM, our server is running on 64-bit JVM. Client will send Java objects to server, and vice versa.
    My past experience suggested when sending Java objects between client and server, both client and server needs to be compiled under the same JVM version. Any advice?
    Christy

    My past experience suggested when sending Java
    objects between client and server, both client and
    server needs to be compiled under the same JVM
    version. Any advice?This is only a case if you omit explicit serialVersionUID. My advice is to ALWAYS specify it for classes you want to serialize over the wire or put into persistent storage. It is way too tricky to rely on default one to fail half a year later when some new programmer adds one new public method to a class.
    Unless you need to deserialize already existing resources, there is no need to put any magic number in serialVersionUID - just put 1 for every class you create and possibly increase it by 1 every time you want to make incompatible version (which is not happening so often, as in real world you often try to stay as compatible as possible)

  • Using transaction activation policy together with TOPLINK Java object/relational mapping "commit and resume" transaction?

    Has any one has experience using WLE transaction context together with TOPLINK Java
    version of "commit and resume" context?

    Has any one has experience using WLE transaction context together with TOPLINK Java
    version of "commit and resume" context?

  • How can I call a java object from Web dynpro ABAP application?

    I made Web dynpro ABAP application and posted it to SAP EP.
    For certain business purpose, we need to call external 3rd party java object using 3rd party's java api in Web dynpro application.
    Is there anybody who experienced this kind of java interface issue?
    I know Web dynpro Java environment can fully support this kind of requirement. but regarding Web dynpro ABAP, I couldn't find any clue for this.
    Any comment or suggestion would be greatly appreciated.
    Thanks,
    Raymond, ABAP Consultant

    if you have jco configured, then you can make calls to java api from ABAP .
    check out this weblog.
    /people/gregor.wolf3/blog/2004/08/26/setup-and-test-sap-java-connector-outbound-connection
    Raja

Maybe you are looking for