Refresh Java Objects From Toplink Map
To add a many to many relationship to my toplink map, I added a field in my .java class like this:
/**Map addressCollection <-> com.goyman.Akira.model.Address
* @associates <{com.goyman.Akira.model.Address}>
private List addressCollection;Then, the addressCollection map appeared in my toplink descriptor, I mapped it correctly, and now I want to know if I have to manualy write the accessor and collection management method (like addAddress...) or if something automated exists.
Regards
Kuon
Relationships will be automatically managed for you by TopLink but you may want to write accessors and add/removeAddress to use these methods in your business logic.
Hope this helps.
Anuj
Similar Messages
-
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 -
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 ,
SambaSamba,
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 -
Persistenance for Java Objects Using Toplink
Hi All Happy New Year
I am trying the a tutorial in Jdeveloper 10.1.3.0.4 called
Provide Persistenance for Java Objects Using Toplink.
I have followed the instructions and get the following error.
com.evermind.reflect.UndeclaredExceptionTypeException: oracle.oc4j.rmi.OracleRemoteException
at __Proxy1.persistEntity(Unknown Source)
at acme.ejb.session.EmpSessionClient.main(EmpSessionClient.java:29)
oracle.oc4j.rmi.OracleRemoteException: Invocation error: java.lang.NoSuchMethodException: acme.ejb.session.EmpSession.persistEntity(java.lang.Object)
The release notes mention TopLink POJO's Must Implement java.io.Serializable When Returned From a Session Bean's Remote Interface (4902787) When creating a session bean facade for TopLink POJO objects, you must implement java.io.Serializable for each of the TopLink POJO objects returned from the SessionBean facade through a remote interface. This is typically required when using ADF Swing, a EJB Sample Client, or when your EJB Session Bean resides on a separate application server from the client. You can also tell you you need to implement java.io.Serializable when you get the following exception:
com.evermind.reflect.UndeclaredExceptionTypeException:
/oracle.oc4j.rmi.OracleRemoteException/
at __Proxy1.[Your Class Name Here] (Unknown Source)
The workaround is to manually edit each POJO object to implement java.io.Serializable.
I have only one POJO which is declared as follows:
public class EmpInfo implements Serializable {
Can anybody help me understand what I need to do to get it to work?
Many Thanks in AdvanceHi,
can you send me your test scenario/project at anuj dot k dot jain at oracle dot com. I tried reproducing this but was unable to do so.
Thanks,
anuj dot k dot jain at oracle dot com -
Error Generating Java Objects using TopLink
Running online tutorial: Build a Web Application with ADF Faces and Oracle TopLink
Generated errors when trying to build Java Objects From Table Wizard at step 9.
[b]java.lang.NullPointerException
at oracle.ideimpl.log.TabbedLogManager.getMsgPage(TabbedLogManager.java:101)
at oracle.toplink.addin.log.POJOGenerationLoggingAdapter.updateTask(POJOGenerationLoggingAdapter.java:42)
at oracle.toplink.addin.mappingcreation.MappingCreatorImpl.fireTaskUpdated(MappingCreatorImpl.java:1049)
at oracle.toplink.addin.mappingcreation.MappingCreatorImpl.generateMappedDescriptorsForTables(MappingCreatorImpl.java:231)
at oracle.toplink.addin.mappingcreation.MappingCreatorImpl.generateMappedDescriptorsForTables(MappingCreatorImpl.java:201)
at oracle.toplink.addin.wizard.jobgeneration.JobWizard$1.construct(JobWizard.java:401)
at oracle.ide.util.SwingWorker$1.run(SwingWorker.java:119)
at java.lang.Thread.run(Thread.java:595)
Any help welcomed
regards
JohnSolved!!!
I had installed JDeveloper 10g inside a directory that had a space in the directory name. -
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 AMYou 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. -
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 muchThere 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 -
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> -
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!) -
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?
ChristyMy 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) -
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.
-
Newbie question on how to return java objects from java stored procedures
Hi,
As you may guess, i'm new to this.
I have a stored procedure that does some calculations and creates a list of java objects as the result of the query.
How would I return the list from the database to the client application?
Would I have to create an Oracle type that maps to the java object?
Please help.
JagHi Jag,
Your question is very vague (to me). Perhaps you could post what you have done so far? Have you tried looking through the Sample Code page of the Technet Web site, or tried searching the Ask tom Web site, or MetaLink?
Good Luck,
Avi. -
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 Consultantif 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
-
Creating floppy disk images (from Disk Utility) recognized by Parallels
Hi there, After making the Parallels plunge last week, and installing a couple of my old OS's in it, I unearthed my old MS-DOS 6.22 disks. (remember that, boys and girls?) With the help of my brother, I managed to export the contents onto a USB flash
-
Hi Guys, If i dont want to use IDOCS and PROXY and applicatoin server, what is the other way i can send data to Xi from R3 ? Also let me know what type of connection setup is required if there is any other means. Thank You!
-
With 10.2.1 update, my Z10 has twice deleted all my text messages. It seems to be a bad glitch.
-
May I increase available storage on my iPad mini? Model MD540FD/A.
Due to problems during uprade to iOS 8.02 I recognized, that there are only 4.5 GB available storage ON my iPad mini, so I had to erase some apps to be preparede for upgrad. Are there any possibilities to send the iPad to Apple to let them increase t
-
Split View Resize Panels Via Javascript
using Javascript is there a way to resize the panels in split view? make one view larger than the other?