Parent/Child BC4J Entity Object Sequence # Generation

If anyone can help us in this we greatly appreciate it. We are using DBSequence data type to poplulate the parent entity with the sequence #; however, we need to populate the child entity with the same sequence #.
We have a DB Trigger for every insert of the parent's key and it's working great but what do we need to do for populating the child record.
Is there a way to get the sequence # as a part of the this code for the child entity object.
protected void create(AttributeList attributeList)
super.create(attributeList);
SequenceImpl mySeq = new SequenceImpl("MY_SEQ",getDBTransaction());
setMyObjectId(mySeq.getSequenceNumber());
Thank you,
Kamran

Well,
I still can't insert the parent's primary key as a forign key automatically. Like in the Dept/Emp situation, I need to setup the supporting Impl files so it would insert the Dept No automatically as a part of the Employee creation.
New info : Here is a sample of what I am trying to accomplish. Sorry I could
have been more clear:
I am sending you my Workspace using Scott's table Dept and Emp. In my JSP file,
The user needs to input the Department information and some of the Employee
info, but the same deptno generated for the Dept record needs to be populated
for the Employee at the time of submit.
Please let me know if you need anything else.
Thank you,
Kamran
Creat_Emp.jsp
<%@ taglib uri="/webapp/DataTags.tld" prefix="jbo" %>
<%@ page contentType="text/html;charset=windows-1252"%>
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
<TITLE>
Hello World
</TITLE>
</HEAD>
<BODY>
<jbo:ApplicationModule id="Mypackage2Module"
configname="mypackage2.Mypackage2Module.Mypackage2ModuleLocal"
releasemode="Stateful" />
<jbo:DataSource id="Dept" appid="Mypackage2Module" viewobject="DeptView" />
<jbo:DataSource id="Emp" appid="Mypackage2Module" viewobject="EmpView" />
<jbo:Row id="myrow" datasource="Dept" action="Create" >
<jbo:SetAttribute dataitem="*" />
</jbo:Row>
<jbo:Row id="myrow5" datasource="Emp" action="Create" >
<jbo:SetAttribute dataitem="*" />
</jbo:Row>
<form NAME="sForm" action="Submit.jsp" >
<td><h3> DAAO <br> New Dept Entry Screen</h3></td>
<tr>
<TABLE bgColor="#c0c0c0" cellspacing="0" cellpadding="0" border="0" frame="box"
style="WIDTH: 530px; HEIGHT: 34px" >
<TR>
<TD><font color=darkyellow >Dept No:<br><jbo:InputText datasource="Dept"
dataitem="Deptno" ></jbo:InputText></TD>
<TD><font color=darkyellow >Dept Name:<br><jbo:InputText datasource="Dept"
dataitem="Dname" ></jbo:InputText></TD>
<TD><font color=darkyellow >Dept Location:<br><jbo:InputText datasource="Dept"
dataitem="Loc" ></jbo:InputText></TD>
</TABLE>
<TABLE bgColor="#c0c0c0" cellspacing="0" cellpadding="0" border="0" frame="box"
style="WIDTH: 530px; HEIGHT: 34px" >
<TR>
<TD><font color=darkyellow >Emp Dept No:<br><jbo:InputText datasource="Emp"
dataitem="Deptno" ></jbo:InputText></TD>
<TD><font color=darkyellow >Emp Id<jbo:InputText datasource="Emp"
dataitem="Empno" ></jbo:InputText>
<TD><font color=darkyellow >Emp Name:<br><jbo:InputText datasource="Emp"
dataitem="Ename" ></jbo:InputText></TD>
<TD><font color=darkyellow >Emp Job:<br><jbo:InputText datasource="Emp"
dataitem="Job" ></jbo:InputText></TD>
</TR>
</TABLE>
<TABLE bgColor="#c0c0c0" cellspacing="0" cellpadding="0" border="0" frame="box"
style="WIDTH: 530px; HEIGHT: 34px" >
<TR>
<TD><font color=darkyellow >Emp Mgr:<br><jbo:InputText datasource="Emp"
dataitem="Mgr" ></jbo:InputText></TD>
</TABLE>
<input name="RowKeyValue" type="hidden" value="<jbo:ShowValue
datasource="Emp" dataitem="RowKey"/>" />
<input type="submit" value="Save" /> <input type="reset" value="Clear
Screen"/> <input type="BUTTON" value="Q&A" onClick="Create_new_qa.jsp">
</form>
<form NAME="qForm" action="Create_New_Qa2.jsp" ></TD>
<input type="submit" value="Q&A" />
</form>
</body>
<jbo:ReleasePageResources releasemode="Stateless" />
</html>
Here is the submit.jsp
<%@ page language="java" contentType="text/html;charset=WINDOWS-1252" %>
<html xmlns:jbo="foo">
<body>
<center>
<br>
<%@ taglib uri="/webapp/DataTags.tld" prefix="jbo" %>
<br>
<jbo:ApplicationModule id="Mypackage2Module" configname="mypackage2.Mypackage2Module.Mypackage2ModuleLocal" releasemode="Stateful" />
<jbo:DataSource id="Dept" appid="Mypackage2Module" viewobject="DeptView" />
<jbo:DataSource id="Emp" appid="Mypackage2Module" viewobject="EmpView" />
<jbo:Row id="myrow" datasource="Dept" action="create" >
<jbo:SetAttribute dataitem="*" />
</jbo:Row>
<jbo:Row id="myrow5" datasource="Emp" action="Create" >
<jbo:SetAttribute dataitem="*" />
</jbo:Row>
<%
try
%>
<jbo:PostChanges appid="Mypackage2Module" />
<jbo:Commit appid="Mypackage2Module"/>
<p><font face="Arial, Helvetica, sans-serif"><b><font color="006699">DAAO Case Saved Successfully! </b></font></font> </p>
<%
catch(Exception exc)
%>
<title>this page will be displayed</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#FFFFFF">
<h1> Attenion the following error has occured:</h1><br>
<%
String error_msg = exc.getMessage();
if(exc instanceof oracle.jbo.JboException)
oracle.jbo.JboException jboex = (oracle.jbo.JboException)exc;
String sMsg = jboex.getDetailMessage();
out.println("<center>JBO Error:" + sMsg + "</center>");
// grab exception object. type cast to jbo object then get details
// parse details for specific error
Object[] details = jboex.getDetails();
if ( sMsg.startsWith("JBO-26041") )
if (
(details !=null)
&& (details.length >0 )
&& (details[0] instanceof java.sql.SQLException )
java.sql.SQLException sourceException = (java.sql.SQLException)(details[0]);
int sqlErrorCode = sourceException.getErrorCode();
if (sqlErrorCode == 1400)
out.println("<br><br><b><font color=\"006699\">One or more of the following required fields (Labeled in Red) have not been entered: </b></font></center><b>");
else
out.println("<br><br><b><font color=\"006699\"> Already exist on our system!! </b></font></center><b>");
if ( sMsg.startsWith("JBO-26041") )
else // unknown JBO exception
} //JBO exception instance
%>
<jbo:ReleasePageResources releasemode="Stateless"/>
<%
return;
%>
<br>
<br>
<form action="main.html" method= onclick><input type="submit" value="Back to Main"></form>
</center>
</body>
<jbo:ReleasePageResources releasemode="Stateless"/>
</html>

Similar Messages

  • BC4J Entity object validation and JSP

    Hi, I've been trying to implement BC4J best practices as per a previous thread with Steven Muench.
    I've placed all my business logic/validation in the entity object create and validateEntity methods. This works perfectly in the tester utility.
    In a JSP page the first time around the error raised also gets displayed properly prompting the user to go back and fix his data entry. The problem is that the error keeps reappearing even after the data has been fixed.
    We use web beans to perform the save using standard create/setAttribute/InsertRow/commit logic.
    The whole setup works perfectly in JSP if there are no errors in the data.
    Any pointers or ideas?
    Thanks.
    null

    productNew.jsp
    <FORM NAME="saveForm" METHOD=POST ACTION="productSave.jsp">
    <table align="center">
    <tr>
    <td>
    <div align="right">Product Code:</div>
    </td>
    <td>
    <input type="text" name="productcode" size="6" maxlength="6">
    </td>
    </tr>
    <tr>
    <td>
    <div align="right">Product Sname:</div>
    </td>
    <td>
    <input type="text" name="productsname" size="20" maxlength="20">
    </td>
    </tr>
    <tr>
    <td height="19">
    <div align="right">Product Name:</div>
    </td>
    <td height="19">
    <input type="text" name="productname" size="45" maxlength="45">
    </td>
    </tr>
    <tr>
    <td>
    <div align="right">Product Type:</div>
    </td>
    <td>
    <jsp:useBean class="com.palmtreebusiness.edms.products.jsp.LovBean" id="lov1" scope="request">
    <%
    lov1.setLovDefault("None Selected");
    lov1.setLovKey(0);
    lov1.setLovKeyDescription(1);
    lov1.setJSOnChangeMethod("");
    lov1.setLovHTMLField("producttypekey");
    lov1.initialize(pageContext, "productsjsp_com_palmtreebusiness_edms_products_bc4j_bc4jmodule.ProducttypetbView");
    lov1.render();
    %>
    </jsp:useBean> </td>
    </tr>
    <tr>
    <td>
    <div align="right">Product Sub Class:</div>
    </td>
    <td>
    <jsp:useBean class="com.palmtreebusiness.edms.products.jsp.LovBean" id="lov2" scope="request">
    <%
    lov2.setLovDefault("All Selected");
    lov2.setLovKey(0);
    lov2.setLovKeyDescription(1);
    lov2.setJSOnChangeMethod("");
    lov2.setLovHTMLField("productsubclasskey");
    lov2.initialize(pageContext, "productsjsp_com_palmtreebusiness_edms_products_bc4j_bc4jmodule.ProductsubclasstbView");
    lov2.render();
    %>
    </jsp:useBean>
    </td>
    </tr>
    <tr>
    <td>
    <div align="right">STCC DG Code:</div>
    </td>
    <td>
    <input type="text" name="stccdgcodekey" size="10" maxlength="10">
    </td>
    </tr>
    <tr>
    <td>
    <div align="right">Harmonized Code:</div>
    </td>
    <td>
    <input type="text" name="harmonizedcode" size="20" maxlength="20">
    </td>
    </tr>
    </table>
    </form>
    productSave.jsp
    <%@ page language = "java" errorPage="errorpage.jsp" import = "java.util.*, oracle.jbo.*, javax.naming.*, oracle.jdeveloper.html.*, oracle.jbo.html.databeans.*" contentType="text/html;charset=ISO-8859-1"%>
    <%
    // make sure the application is registered
    oracle.jbo.html.jsp.JSPApplicationRegistry.registerApplicationFromPropertyFile(session , "productsjsp_com_palmtreebusiness_edms_products_bc4j_bc4jmodule");
    %>
    <HTML>
    <HEAD>
    <jsp:useBean id="prod" class="com.palmtreebusiness.edms.products.jsp.productSavebean" scope="request">
    <%
    try {
    prod.initialize(pageContext, "productsjsp_com_palmtreebusiness_edms_products_bc4j_bc4jmodule.ProducttbView");
    prod.setReleaseApplicationResources(true);
    prod.save();
    response.sendRedirect("productList.jsp");
    response.setStatus(response.SC_MOVED_TEMPORARILY);
    catch (Exception ex) {
    out.println("<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=ISO-8859-1\">");
    out.println("<META NAME=\"GENERATOR\" CONTENT=\"Oracle JDeveloper\">");
    out.println("<TITLE>");
    out.println("Save Error");
    out.println("</TITLE>");
    out.println("</HEAD>");
    out.println("<BODY>");
    out.println("A save error occured.<br><br>");
    out.println(ex.getMessage());
    out.println("<br><br>Plese use the back feature of your browser to go back to the form and fix your data.");
    out.println("</BODY>");
    out.println("</HTML>");
    %>
    </jsp:useBean>
    saveBean.java
    public void save() throws oracle.jbo.JboException {
    Row rRow;
    System.out.println(request.getParameter("producttypekey"));
    System.out.println(request.getParameter("productsubclasskey"));
    try {
    // get the rowset instance
    RowSet rSet = getRowSet();
    rRow = rSet.createRow();
    rRow.setAttribute("Producttypekey", new Number(request.getParameter("producttypekey")));
    rRow.setAttribute("Productsubclasskey", new Number(request.getParameter("productsubclasskey")));
    rRow.setAttribute("Productcode", request.getParameter("productcode"));
    rRow.setAttribute("Productsname", request.getParameter("productsname"));
    rRow.setAttribute("Productname", request.getParameter("productname"));
    rRow.setAttribute("Stccdgcodekey", new Number(request.getParameter("stccdgcodekey")));
    rRow.setAttribute("Harmonizedcode", request.getParameter("harmonizedcode"));
    rSet.insertRow(rRow);
    rSet.getApplicationModule().getTransaction().commit();
    catch (oracle.jbo.JboException jboex) {
    qView.reset();
    throw new oracle.jbo.JboException(jboex.getMessage());
    catch (Exception ex) {
    throw new oracle.jbo.JboException(ex.getMessage());
    producttbimpl.java
    public void create(AttributeList attributeList) {
    try {
    SequenceImpl s = new SequenceImpl("producttb_seq", getDBTransaction());
    Integer next = (Integer)s.getData();
    setProductkey(new Number(next.intValue()));
    super.create(attributeList);
    catch (Exception jboe) {
    if (jboe instanceof oracle.jbo.JboException) {
    oracle.jbo.JboException ex2 = (oracle.jbo.JboException)jboe;
    if (ex2.getErrorCode().equals("25030")) {
    return;
    throw new oracle.jbo.JboException("Unable to create this record!\n" + jboe.getMessage());
    public void validateEntity() throws oracle.jbo.JboException {
    //TODO: Add custom implementation.
    Number nSubclasskey, nTypekey;
    Number nSubclassFkey, nTypeFkey;
    try {
    nSubclassFkey = getProductsubclasstb().getProductclasskey();
    nTypeFkey = getProducttypetb().getProducttypekey();
    nSubclasskey = getProductsubclasskey();
    nTypekey = getProducttypekey();
    if (!nSubclassFkey.equals(nSubclasskey) &#0124; &#0124; !nTypeFkey.equals(nTypekey)) {
    throw new oracle.jbo.JboException("You need to specify a product sub class and type first!");
    catch (Exception ex) {
    throw new oracle.jbo.JboException("You need to specify a product sub class and type first!");
    super.validateEntity();
    null

  • Error Extending the OAEntityImpl class when creating a BC4J  Entity Object

    I have created an EO based on an Oracle Apps table and extended the OAEntityDefImpl, OAEntityCache and OAEntityImpl classes as specified in the OA Framework Developers Guide when creating EO's via the BC4J wizard.
    When I build my Business Components package I recive an error stating that the Impl class should be declared abstract.
    Error(14,8): class oracle.apps.xxtpc.arinvoices.schema.TpcApInvoicesEO2Impl should be declared abstract; it does not define method setLastUpdateLogin(oracle.jbo.domain.Number) in class oracle.apps.fnd.framework.server.OAEntityImpl
    When I modify this class to declare it abstract and then try to test (via the AM test function) the VO that I created based on this EO - I receive an oracle.jbo.RowCreateException: JBO-25017.
    Do you think that this has anything to do with modifying the Impl class to make it abstract? I can create another VO against the same table by creating a SQL statement against it and not basing it off of the EO and this VO will run correctly via the AM tester.
    Thanks,
    Chris
    oracle.jbo.RowCreateException: JBO-25017: Error while creating a new entity row for TpcApInvoicesEO.
         at oracle.jbo.server.EntityDefImpl.createBlankInstance(EntityDefImpl.java:1054)
         at oracle.jbo.server.ViewRowImpl.createMissingEntities(ViewRowImpl.java:1532)
         at oracle.jbo.server.ViewRowImpl.init(ViewRowImpl.java:236)
         at oracle.jbo.server.ViewDefImpl.createBlankInstance(ViewDefImpl.java:1050)
         at oracle.jbo.server.ViewDefImpl.createInstanceFromResultSet(ViewDefImpl.java:1007)
         at oracle.jbo.server.ViewObjectImpl.createRowFromResultSet(ViewObjectImpl.java:2643)

    The problem was that there were no audit columns in the table that I was querying.

  • How do I create parent/child relationship between objects? so that if I change one, I change all

    I have multiple instances of an object, and I would like to make any changes that I put on one of these objects to perpetuate and change on the other instances of the object

    turn your object into a symbol, and place multiple instances of it on the artboard, when you edit the symbol all instances will update.

  • Generation v/s Parent/Child

    Hi, i try build a dimension with generation and parent/child option. Firts build the dimension with generation preference and after build with parent/child. I have two rules files, one with generation and other with parent/child these order, but when run the rule file for parent/child the memebers not add a dimension, why????<BR><BR>Saludos.

    Hi Saludos,<BR>I have two rules files, one with generation and other with parent/child these order, but when run the rule file for parent/child the memebers not add a dimension - u mean to say in the outline the dimension name is not being created or the children for the dimension is not created. If it is first one then check whether you mentioned the rul file name or the outline name to create the dimension name. If the issue is the 2nd one then check whether you had chosen the method of dimension memeber creation (generation/level/parent-child). The default is Generation build.<BR><BR>Hope you got some idea, if i understood the problem in the right sense.<BR><BR>Regards<BR>R.Prasanna

  • Hide columns in JClient in function to BC4J Entity

    Hi:
    I need to hide some columns dynamically in my JClient Panel in base to conditional BC4J Entity object bussiness rule.
    For example if i put my pseudocode in Oracle Forms based (i don't remeber the syntaxis well): "if my Deparment.idDepartment = 1000 then....Hide the Employee.Salary".
    Now, in JDeveloper, in my 'DepartmentImpl.java' put the condition, but i know, i can't write code to hide the column in runtime mode here. I need to do that in JClient.
    How can i do this, passing a parameter between BC4J and JClient?
    Regards
    Marco H.

    Shailesh:
    The code not works well for me. I try to explain my requieriment:
    I have a field named "Capturahoras". If "Capturahoras" is equal to "S" then, enabled mHorastrabajados, otherwise, disabled mHorastrabajados.
    My "Idconepto" is my PK and when i selected another value for my PK, my field "Capturahoras" should be changed to "S" or "N" (Yes or Not).
    Sorry, but i'm not an expert for JDev and some months ago i have been programming in Oracle Forms.
    I put my code here but not works well:
    * the JbInit method
    public void jbInit() throws Exception
    // Layout definition for this panel
    dataPanel.setLayout(panelLayout);
    dataPanel.setMinimumSize(new Dimension(100, 100));
    this.setLayout(borderLayout);
    // Code support form attribute: Concepto
    mIdconcepto.setDocument(JUTextFieldBinding.createAttributeBinding(panelBinding, mIdconcepto, "RhMovsincidendetalleView", null, "RhMovsincidendetalleViewIter", "Idconcepto"));
    mIdconcepto.setColumns(3);
    mIdconcepto.addActionListener(new ActionListener()
    public void actionPerformed(ActionEvent e)
    mIdconcepto_actionPerformed(e);
    ComboConcepto.setModel(JUComboBoxBinding.createLovBinding(panelBinding, ComboConcepto, "RhMovsincidendetalleView", null, "RhMovsincidendetalleViewIter", new String[] {"Idconcepto"}, "RhConceptoView", new String[] {"Idconcepto"}, new String[] {"Nomcorto"}, null, null));
    dataPanel.add(labelIdconcepto, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1));
    dataPanel.add(mIdconcepto, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1));
    labelIdconcepto.setLabelFor(mIdconcepto);
    mIdconcepto.setColumns(3);
    mIdconcepto.setToolTipText(panelBinding.getTooltip("RhMovsincidendetalleView", "Idconcepto", null));
    labelIdconcepto.setText(panelBinding.getLabel("RhMovsincidendetalleView", "Idconcepto", null));
    // Code support form attribute: Secuencia
    mIdsecuencia.setDocument(JUTextFieldBinding.createAttributeBinding(panelBinding, mIdsecuencia, "RhMovsincidendetalleView", null, "RhMovsincidendetalleViewIter", "Idsecuencia"));
    dataPanel.add(labelIdsecuencia, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1));
    dataPanel.add(mIdsecuencia, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1));
    labelIdsecuencia.setLabelFor(mIdsecuencia);
    mIdsecuencia.setColumns(4);
    mIdsecuencia.setToolTipText(panelBinding.getTooltip("RhMovsincidendetalleView", "Idsecuencia", null));
    labelIdsecuencia.setText(panelBinding.getLabel("RhMovsincidendetalleView", "Idsecuencia", null));
    // Code support form attribute: Dias trabajados
    mDiastrabajados.setDocument(JUTextFieldBinding.createAttributeBinding(panelBinding, mDiastrabajados, "RhMovsincidendetalleView", null, "RhMovsincidendetalleViewIter", "Diastrabajados"));
    dataPanel.add(labelDiastrabajados, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1));
    dataPanel.add(mDiastrabajados, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1));
    labelDiastrabajados.setLabelFor(mDiastrabajados);
    mDiastrabajados.setColumns(7);
    mDiastrabajados.setToolTipText(panelBinding.getTooltip("RhMovsincidendetalleView", "Diastrabajados", null));
    labelDiastrabajados.setText(panelBinding.getLabel("RhMovsincidendetalleView", "Diastrabajados", null));
    // Code support form attribute: Horas trabajadas
    mHorastrabajados.setDocument(JUTextFieldBinding.createAttributeBinding(panelBinding, mHorastrabajados, "RhMovsincidendetalleView", null, "RhMovsincidendetalleViewIter", "Horastrabajados"));
    dataPanel.add(labelHorastrabajados, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1));
    dataPanel.add(mHorastrabajados, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1));
    labelHorastrabajados.setLabelFor(mHorastrabajados);
    mHorastrabajados.setColumns(5);
    mHorastrabajados.setToolTipText(panelBinding.getTooltip("RhMovsincidendetalleView", "Horastrabajados", null));
    labelHorastrabajados.setText(panelBinding.getLabel("RhMovsincidendetalleView", "Horastrabajados", null));
    // Code support form attribute: Importe
    mImporte.setDocument(JUTextFieldBinding.createAttributeBinding(panelBinding, mImporte, "RhMovsincidendetalleView", null, "RhMovsincidendetalleViewIter", "Importe"));
    dataPanel.add(labelImporte, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1));
    dataPanel.add(mImporte, new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1));
    labelImporte.setLabelFor(mImporte);
    mImporte.setColumns(11);
    mImporte.setToolTipText(panelBinding.getTooltip("RhMovsincidendetalleView", "Importe", null));
    labelImporte.setText(panelBinding.getLabel("RhMovsincidendetalleView", "Importe", null));
    // Code support form attribute: Turno
    mTurno.setDocument(JUTextFieldBinding.createAttributeBinding(panelBinding, mTurno, "RhMovsincidendetalleView", null, "RhMovsincidendetalleViewIter", "Turno"));
    dataPanel.add(labelTurno, new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1));
    dataPanel.add(mTurno, new GridBagConstraints(1, 5, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1));
    labelTurno.setLabelFor(mTurno);
    mTurno.setColumns(2);
    mTurno.setToolTipText(panelBinding.getTooltip("RhMovsincidendetalleView", "Turno", null));
    labelTurno.setText(panelBinding.getLabel("RhMovsincidendetalleView", "Turno", null));
    // Code support form attribute: Centro de costos
    mCentrocostos.setDocument(JUTextFieldBinding.createAttributeBinding(panelBinding, mCentrocostos, "RhMovsincidendetalleView", null, "RhMovsincidendetalleViewIter", "Centrocostos"));
    dataPanel.add(labelCentrocostos, new GridBagConstraints(0, 6, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1));
    dataPanel.add(mCentrocostos, new GridBagConstraints(1, 6, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1));
    dataPanel.add(ComboConcepto, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 1, 1));
    labelCentrocostos.setLabelFor(mCentrocostos);
    mCentrocostos.setColumns(20);
    mCentrocostos.setToolTipText(panelBinding.getTooltip("RhMovsincidendetalleView", "Centrocostos", null));
    // Add for Marco
    panelBinding.findIterBinding("RhMovsincidendetalleViewIter").getRowSetIterator().addListener(new oracle.jbo.RowSetListener()
    * Invoked when the range changes.
    * @param event a description of the new ranges.
    public void rangeRefreshed(oracle.jbo.RangeRefreshEvent event){}
    * Invoked when the range is scrolled.
    * @param event a description of the new range.
    public void rangeScrolled(oracle.jbo.ScrollEvent event){}
    * Invoked when a row has been inserted.
    * @param event a description of the new Row object.
    public void rowInserted(oracle.jbo.InsertEvent event){}
    * Invoked when a row has been deleted.
    * @param event a description of the deleted Row object.
    public void rowDeleted(oracle.jbo.DeleteEvent event){}
    * Invoked when an attribute of the row has been changed.
    * @param event a description of the modified Row object.
    public void rowUpdated(oracle.jbo.UpdateEvent event){}
    * Invoked when the current-row designation changes.
    * @param event a description of the new and previous current rows.
    public void navigated(oracle.jbo.NavigationEvent event)
    String str = null;
    oracle.jbo.Row r = event.getRow();
    if (r != null)
    str = (String) r.getAttribute("Capturahoras");
    if (str != null && str == "S")
    mHorastrabajados.setEnabled(true);
    labelHorastrabajados.setEnabled(true);
    else
    mHorastrabajados.setEnabled(false);
    labelHorastrabajados.setEnabled(false);
    Thanks
    Marco

  • Problem with saving Parent - Child  View Objects in ADF 11g.

    Hi Every one,
    I have a requirment, something like I will be displaying some data on my jsff screen based on one Transient View Object. Whenever user clicks on Save button, I have to do following steps in my AMImpl.
    -> Preapre dynamically Parent View Object Rows based on some logic
    -> Prepare dynamically Child View object Rows and invoke insertRow method on respective child view object.
    When I say commit() First Parent ViewObject data need to be saved and then Child View object data has to be saved. I am having Parent - Child Key relation ship btw these two ViewObjects. Some how I am populating the Parent Primary key in the Child View Object. Please suggest me If there is any other alternative to this.
    Thanks

    I got the solution, Enabling the check box option for Master - Detail Entity association (CompositionAssociation -> Cascade Update Key Attributes) resolved the issue.
    Thanks

  • BC4J: problems creating view object with multiple entity objects

    Hi,
    I working with a view object which contains two entity objects with parent-child relationship like this:
    ViewObject - ParentEntityObject - PId
    PAttribute
    CId (FK)
    (- ParentChildAssociation)
    - ChildEntityObject - CId
    - CAttribute
    The 'Read Only' and 'References' options are checked for the association in the view object.
    I'm creating a new row using this view object. The parent object should be created new and the child object already exists in the database, so I'm setting only the attributes of the parent object (including foreign key).
    After creating the row I display it in a jbo:DataTable and only those attributes coming from the parent object are displayed. The attributes of the child object are not set. After a commit all attributes appear.
    The problem is, that I want to display the new row with all attributes to the users BEFORE they commit.
    I tried to set the child attributes, but they are read only by definition and even when I unchecked the 'Read Only' option and set the attributes to 'Always Updateable' in the view object it is giving me
    JBO-27008: Attribute set for CAttribute in view object ViewObject failed.
    Is there a way to make all attributes of the child object visible in the view object without committing changes?
    (JDev 9.0.2.822)
    Any help would be appreciated.
    Regards,
    Christian

    Once again the structure, sorry.
    ViewObject
    |-ParentEntityObject
    ..|-PId
    ..|-PAttribute
    ..|-CId (FK)
    |-ParentChildAssociation
    |-ChildEntityObject
    ..|-CId
    ..|-CAttribute
    Christian

  • Entity Currency Adj, Parent Currency adj for Parent-child with same currenc

    Hi,
    In 11.1.2.1 I noticed that if parent and base entity currencies are same, entity currency and entity currency adjustments equal parent currency and parent currency adjustments respectively. If the currencies are different, the entity currency total gets translated to parent currency and post that, we can pass adjustments at PCA level.
    I had an understanding that Entity Currency total always rolls upto Parent currency irrespective of whether the currencies of base and parent are same/different.
    Is this something new with version 11 or has it always been like this?
    Thanks,
    S

    I don't follow your explanation. To be very clear: <Parent Curr Adjs> is NOT the translation of <Entity Curr Adjs>. This will never happen. HFM takes <Entity Curr Total> and translates that into the target currency. The only time <Parent Curr Adjs> will equal <Entity Curr Adjs> is when they are indeed the very same currency. In that case there is no translation but instead two names for the same data set.
    --Chris                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • How to intercept update on entity object using bc4j

    Hi all,
    I need to intercept a user from updating a particular entity object and create a new entity instead. I have a particular row in a database table that has a primary key with special meaning. If a user attempts to update this row, I want to automatically create a new row in the table with the information they entered and leave the original row unmodified. Any suggestions on how to do this at the entity layer?
    Thanks
    Mike

    Hi Sung,
    I've created 2 Entity Objects, named TestEo and OtherEo. The logic I've included is as follows: Before posting data for TestEo to the database (thus as part of the prepareForDML), I create a new instance of OtherEo, using the createBlankInstance method exposed on OtherEoDefImpl.
    However, the instance thus created ends up in a STATUS_UNMODIFIED, regardless of locking mode (I've managed to eliminate the locking mode as an issue).
    Could you give me an idea of where I'm going wrong? I've attached the prepareForDML() (with diagnostic msgs) and createBlankInstance() methods below.
    TestEoImpl.prepareForDML()
    protected void prepareForDML(int p0, TransactionEvent p1)
    switch (this.getDBTransaction().getLockingMode())
    case DBTransaction.LOCK_OPTIMISTIC:
    System.out.println("Locking mode: LOCK_OPTIMISTIC");
    break;
    case DBTransaction.LOCK_PESSIMISTIC:
    System.out.println("Locking mode: LOCK_PESSIMISTIC");
    break;
    // TODO: Override this oracle.jbo.server.EntityImpl method
    super.prepareForDML(p0, p1);
    OtherEoDefImpl otherEoDef = (OtherEoDefImpl) EntityDefImpl.findDefObject(
    "testapp.OtherEo");
    System.out.println("Entity Class: " + this.getClass().getName());
    switch (this.getEntityState())
    case EntityImpl.STATUS_DEAD:
    System.out.println("Entity State: STATUS_DEAD");
    break;
    case EntityImpl.STATUS_DELETED:
    System.out.println("Entity State: STATUS_DELETED");
    break;
    case EntityImpl.STATUS_INITIALIZED:
    System.out.println("Entity State: STATUS_INITIALIZED");
    break;
    case EntityImpl.STATUS_MODIFIED:
    System.out.println("Entity State: STATUS_MODIFIED");
    break;
    case EntityImpl.STATUS_NEW:
    System.out.println("Entity State: STATUS_NEW");
    break;
    case EntityImpl.STATUS_UNMODIFIED:
    System.out.println("Entity State: STATUS_UNMODIFIED");
    break;
    EntityImpl otherEo = otherEoDef.createBlankInstance(getDBTransaction());
    System.out.println("Entity Class: " + otherEo.getClass().getName());
    int state = otherEo.getEntityState();
    switch (state)
    case EntityImpl.STATUS_DEAD:
    System.out.println("Entity State: STATUS_DEAD - " + state);
    break;
    case EntityImpl.STATUS_DELETED:
    System.out.println("Entity State: STATUS_DELETED - " + state);
    break;
    case EntityImpl.STATUS_INITIALIZED:
    System.out.println("Entity State: STATUS_INITIALIZED - " + state);
    break;
    case EntityImpl.STATUS_MODIFIED:
    System.out.println("Entity State: STATUS_MODIFIED - " + state);
    break;
    case EntityImpl.STATUS_NEW:
    System.out.println("Entity State: STATUS_NEW - " + state);
    break;
    case EntityImpl.STATUS_UNMODIFIED:
    System.out.println("Entity State: STATUS_UNMODIFIED - " + state);
    break;
    OtherEoDefImpl.createBlankInstance()
    public EntityImpl createBlankInstance(DBTransaction p0)
    // TODO: Override this oracle.jbo.server.EntityDefImpl method
    return super.createBlankInstance(p0);
    Output - Test 1
    Locking mode: LOCK_OPTIMISTIC
    Entity Class: testapp.TestEoImpl
    Entity State: STATUS_NEW
    Entity Class: testapp.OtherEoImpl
    Entity State: STATUS_UNMODIFIED - 1
    Output - Test 2
    Locking mode: LOCK_PESSIMISTIC
    Entity Class: testapp.TestEoImpl
    Entity State: STATUS_NEW
    Entity Class: testapp.OtherEoImpl
    Entity State: STATUS_UNMODIFIED - 1

  • ForEach iterator in parent child relation

    Hi,
    How can i use forEach to iterate parent child view object. Issue it is only able to fetch value of parent vo not child view object values, if I use af:iterator instead of af:forEach it works perfectly. So there is no issue with data.
    But I am not able to iterate child VO.
    <af:forEach items="#{bindings.testVO.rangeSet}"
    var="parent" varStatus="parentRow" >
    <af:outputText value="#{parent.Name}"/> -- it works fine prints value
    <af:forEach items="#{parentRow.childVO.rangeSet}"
    var="child" varStatus="childRow" >
    <af:outputText value="#{child.subject}"/> ---> It doesn't work
    </af:forEach>
    </af:forEach>
    If i use iterator it works fine... But I have to use forEach to generate dynamic id for each component in forEach Loop

    I tried to use af:iterator first but the problem is it is not able to handle dynamic id generation for each component:
    <af:iterator value="#{bindings.companyVO.collectionModel}"
    var="company" varStatus="companyStatus"
    rows="#{bindings.companyVO.rangeSize}">
    <af:iterator value="#{company.employeeVO}"
    var="employee" varStatus ="employeeStatus">
    <af:outputLabel id="emp${companyStatus.index}${employeeStatus.index}" value="#{employeee.empId}"/> ->>> here id is always emp it is not able to get index value and if i used the same code in forLopp it works it is able to fetch dynamic id based on index like emp12 emp13 emp14 etc...
    </af:iterator>
    </af:iterator>

  • Parent-Child post order exception; FK constraint violation

    I've seen the discussion and answer recently in this forum for configuring BC4J
    to post the parent first, then the child, to avoid the FK constraint exception??
    So I have to appologise for re-asking, but I can't get the search function to find
    any thing that needs multiple key words. :(
    I've got two Entities, parent child, with Links, and Association between them on the FK.
    What was the trick to get the framework to correctly post the parent first??
    I've looked over the FkLink and FkAssoc and all these components are included by
    the AppModule...
    Thanks, curt

    Edit the association object between your parent and child entities and set the "Composition" flag (Composite Assocation in the UI), to true. You may elect to enforce "CascadeDelete" option, if you have database Cascade-delete turned on between the associated tables and want to avoid multiple DMLs for the details.

  • How to model parent child relationship with DPL? @Transient?

    Hello All,
    I want to model a parent entity object with a collection of child entities:
    @Entity
    public class Parent{
    @PrimaryKey
    String uuid;
    List&lt;Child&gt; children;
    @Entity
    public class Child{
    @PrimaryKey
    String id;
    I know that the DPL won't support automatic persistence where it'll recursively go through my parent bean and persist my children with one call. Is there a way of applying the equivalent to JPA's @Transient annotation on "children" so I can persist the children manually and have the engine ignore the collection?
    If not and I want to return to the user a Parent with a List named "children," do I have to create a new object which is identical to Parent, but doesn't have the BDB annotations and manually assemble everything? If possible, I'd like to avoid defining redundant objects.
    Thanks in advance,
    Steven
    Harvard Children's Hospital Informatics Program
    Edited by: JavaGeek_Boston on Oct 29, 2008 2:22 PM

    Hi Steven,
    The definition of persistence is here:
    http://www.oracle.com/technology/documentation/berkeley-db/je/java/com/sleepycat/persist/model/Entity.html
    And includes this: "All non-transient instance fields of an entity class, as well as its superclasses and subclasses, are persistent. static and transient fields are not persistent."
    So you can use the Java transient keyword. If that isn't practical because you're using transient in a different way for Java serialization, see the JE @NotPersistent annotation.
    In general a parent-child relationship between entities is implemented almost as you've described, but with a parentId secondary key in the Child to index all children by their parent. This enables a fast lookup of children by their parent ID.
    I suggest looking at this javadoc:
    http://www.oracle.com/technology/documentation/berkeley-db/je/java/com/sleepycat/persist/SecondaryIndex.html
    as it describes all types of entity relationships and the trade-offs involved. The department-employee relationship in these examples is a parent-child relationship.
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Parent/Child Orders

    Hi,
    Does OSM supports Parent/Child orders.
    +(Child order will not start untill Parent order will complete)+
    Regards,
    Harman

    Perhaps it would help if you describe the nature of the cross order dependency.
    In our experience most dependencies that exist between orders are the result of a functional dependency between line items. I'd like to understand your use case so that I can better understand how this is not the case for your situation.
    That aside for the moment, there are several other ways to deal with parent/child order relationships. Here are two that you may find useful:
    1. Rely on OSM order lifecycle events which can be enabled on the Order entity within Design Studio. When enabled, OSM will automatically emit JMS/XML events on a JMS destination that OSM provides whenever an order changes state. You can have an automation plugin listen for the event indicating the parent order has completed after which the child order starts.
    2. Create a custom notification automation plugin which is invoked when the parent order completes. When this happens it can either send a JMS/XML event of your own making similar to #1 above, or it can directly call the OSM XML API using the provided context object (just as with automation plugins) to start the child order (assuming the parent order has the context to locate the child order).
    Brian.

  • JPA One-To-Many Parent-Child Mapping Problem

    I am trying to map an existing legacy Oracle schema that involves a base class table and two subclass tables that are related by a one-to-many relationship which is of a parent-child nature.
    The following exception is generated. Can anybody provide a suggestion to fix the problem?
    Exception [EclipseLink-45] (Eclipse Persistence Services - 2.0.0.v20091127-r5931): org.eclipse.persistence.exceptions.DescriptorException
    Exception Description: Missing mapping for field [BASE_OBJECT.SAMPLE_ID].
    Descriptor: RelationalDescriptor(domain.example.entity.Sample --> [DatabaseTable(BASE_OBJECT), DatabaseTable(SAMPLE)])
    The schema is as follows:
    CREATE TABLE BASE_OBJECT(
    "BASE_OBJECT_ID" INTEGER PRIMARY KEY NOT NULL,
    "NAME" VARCHAR2(128) NOT NULL,
    "DESCRIPTION" CLOB NOT NULL,
    "BASE_OBJECT_KIND" NUMBER(5,0) NOT NULL );
    CREATE TABLE SAMPLE(
    "SAMPLE_ID" INTEGER PRIMARY KEY NOT NULL,
    "SAMPLE_TEXT" VARCHAR2(128) NOT NULL )
    CREATE TABLE SAMPLE_ITEM(
    "SAMPLE_ITEM_ID" INTEGER PRIMARY KEY NOT NULL,
    "SAMPLE_ID" INTEGER NOT NULL,
    "QUANTITY" INTEGER NOT NULL )
    The entities are related as follows:
    SAMPLE.SAMPLE_ID -> BASE_OBJECT.BASE_OBJECT_ID - The PKs that are used to join the sample to the base class
    SAMPLE_ITEM.SAMPLE_ITEM_ID -> BASE_OBJECT.BASE_OBJECT_ID - The PKs that are used to join the sample item to the base class
    SAMPLE_ITEM.SAMPLE_ID -> SAMPLE.SAMPLE_ID - The FK that is used to join the sample item to the sample class as a child of the parent.
    SAMPLE is one to many SAMPLE_ITEM
    The entity classes are as follows:
    @Entity
    @Table( name = "BASE_OBJECT" )
    @Inheritance( strategy = InheritanceType.JOINED )
    @DiscriminatorColumn( name = "BASE_KIND", discriminatorType = DiscriminatorType.INTEGER )
    @DiscriminatorValue( "1" )
    public class BaseObject
    extends SoaEntity
    @Id
    @GeneratedValue( strategy = GenerationType.SEQUENCE, generator = "BaseObjectIdSeqGen" )
    @SequenceGenerator( name = "BaseObjectIdSeqGen", sequenceName = "BASE_OBJECT_PK_SEQ", allocationSize = 1 )
    @Column( name = "BASE_ID" )
    private long baseObjectId = 0;
    @Entity
    @Table( name = "SAMPLE" )
    @PrimaryKeyJoinColumn( name = "SAMPLE_ID" )
    @AttributeOverride(name="baseObjectId", column=@Column(name="SAMPLE_ID"))
    @DiscriminatorValue( "2" )
    public class Sample
    extends BaseObject
    @OneToMany( cascade = CascadeType.ALL )
    @JoinColumn(name="SAMPLE_ID",referencedColumnName="SAMPLE_ID")
    private List<SampleItem> sampleItem = new LinkedList<SampleItem>();
    @Entity
    @Table( name = "SAMPLE_ITEM" )
    @PrimaryKeyJoinColumn( name = "SAMPLE_ITEM_ID" )
    @AttributeOverride(name="baseObjectId", column=@Column(name="SAMPLE_ITEM_ID"))
    @DiscriminatorValue( "3" )
    public class SampleItem
    extends BaseObject
    @Basic( optional = false )
    @Column( name = "SAMPLE_ID" )
    private long sampleId = 0;
    Edited by: Chris-R on Mar 2, 2010 4:45 PM

    Thanks for the thoroughness. There was a mistake in moving the code over for the forum. The field names are correct throughout the original source code.
    BASE_OBJECT_ID is used throughout.
    I suspect the problem lies in the one-to-many sampleItem(s) relationship that is based upon the subclassed item class. (The relationship is actually "sampleItems" in the real code and somehow got changed in the move over.)
    The problem may lie in the mapping of the attribute override in the child class to the referencing of the item class from the parent side of the relationship in the Sample class.
    I further suspect this may be specific to Eclipselink based upon other postings I've seen on the web that have similar problems...
    Any thoughts?
    Edited by: Chris-R on Mar 3, 2010 9:56 AM

Maybe you are looking for

  • How do I revert to iTunes 11.0 or earlier?

    iTunes used to work well with my iPad1, iPhone5, and two iPod5's.  I would periodically synch them in order to create a backup, or transfer any new apps.  Ever since I upgraded to iTunes 11.1.4.62, iTunes will no longer recognize any Apple device.  W

  • How do I transfer apps from iPod to iPad 2?

    how do I transfer apps from iPod to iPad 2?

  • Iphone UK being used in USA

    Hi - i have a O2 phone in UK and i m currently in the USA on vacation. I have the phone with me and wanted to update the phone to 3.0 while i am here. Will this be a problem? will i have activation problems?

  • Link Colour Not Visible In Designer View

    I have searched for an answer to no avail. This is my first attempt at creating a website. I have changed my link colours to reflect the overall design of my site however my links are still coming up in default blue. I used Modify --> Page Properties

  • PSE 8 Layers and Effects

    Hi All my first post here, I came across this forum whikst googling for a solution..... I run Windows 7 and have PSE 8 - last night I was playing with layers and effects in PSE 8 and I clicked on the small blue box with FX written in the corner of th