Not getting foreign key fields not filled in datacontrol palette for EJB app
HelloI am quite new FAD and EJB. I developed an application jdeveloper with levels of JSF and EJB. (I use jdeveloper 10.1.3.5)
For the database to the default human resources database is used. I created the entities for the table EMPLOYEES and DEPARTMENTS.
I also created a session bean and a data control to the session bean.
I'm having a JSF page that receives all the details of a new employee and insert into the database (i.e. persistEntity)
But the constructor used in the data control palette is not filling the MANAGERID and DEPARTMENTID, fields that are
the foreign key constraints for table and EMPLOYEES by result while trying to make persistent entity
with automatically filled fields, an error message is thrown.
If I've used ADF BC instead of the EJB then I could fill all the fields including MANAGERID and DEPARTMENTID.
Is it possible to have two fields text Manager and Department in the jsf to insert the details of the employee with EJB as a model?.
If possible how to bind the values of these fields to the entity used in EJB object.
Kindly need your ideas on this.
Thank you
Guna.
Hello
How you use MANAGER_ID and department_id fields, they also flush long (or another digital type), or you don't have them mapped to the entity, something like this
....
@ManyToOne
private Employee manager; // this by default uses the column named MANAGER_ID
@ManyToOne
private Department department; // this by default uses the column named DEPARTMENT_ID
....
If you have mapped them (which is the right path), when you create an employee, you must set these attributes to the persistence of the entity, using employee.setManager (manager) and employee.setDepartment (department). Then, foreign keys filled automatically by your persistence provider (Toplink).
If you use data controls, it's a little different process to define the Manager and the Department, but you should take a look at this tutorial http://www.oracle.com/technology/obe/obe11jdev/ps1/ejb/ejb.html, it will answer many of your questions hopefully.
Pedja
Tags: Java
Similar Questions
-
I need to get the key to my Adobe 11.0 Pro for PC.
I had a power outage and some other recent work. In the process, I had to reload all my software because of a problem in the installation. I was not able to find my key. I have the installation files. I bought my software and downloaded online on 07/07/2014.
I am running Windows 10 Pro.
How can I get my key?
Please login here Adobe ID - log in with your Adobe ID
Then choose Plans & Products > view all > Products > see your products. You will find you your product serial key.
See this KB doc for more information: find the serial number of your product Adobe quickly
Kind regards
Meenakshi
-
WebWorks app not to recognize the plugin for Blackberry app
Hello! I'm portage a webapp Android to WebWorks. My Android application using Phonegap, so when I discovered the new WebWorks used to, it was a great relief. But the problem came when I tried to use the BlackBerry push service, because demand for some strange reason does not recognize the plugins I have installed through the console, just like the documentation says http://developer.blackberry.com/html5/apis/beta/blackberry.app.html.
Since then I have removed everything that belonged to the push service and I installed the com.blackberry.app plugin to test the ways that they are supposed to work. It debugged in the Web Inspector and I have this message.
ReferenceError: Can't find variable: blackberry
This error came from this line in my code:
Console.log ("the State of the screen is:" + blackberry.app.windowState);
In my config.xml file, I have the line:
I am new to this platform and I don't know if the plugins should be called somewhere in the html file or the js to make it work. Or is there something else wrong on how I use the plugins?
BTW: my application uses the last cordova because I developed since the SDK WebWorks 2.0.0.54, but my app Android used Cordova 2.0.0 and this library is called in the html code. So, when I tried to change the cordova for the last file, the application didn't work, so I left there where he was.
In the standard application of Cordova, the application calls app.initialize as follows (additional code left to show the implementation of the call and the scripts required):
...