ADF11g BC CRUD operations
Hi,
Environment: 11g ADF RichFaces,BC
I have a simple form where i save emp data to database. And i have a ADF table to show the list of emp with update and Delete operations.
To Update a record i need to select the record make changes,click Execute this seems to update the buffer and then when we click the Commit button the data is persisted to db.
Please suggest if we can combine both Execute and Commit into One operation.(persist the data on click of "Execute" itself ) (without using a managed bean)
Thanks in Advance
Ram
John,
This doesn't work for me..When i click the Update button the data on screen gets updated but not the data in database. The changes are propogated only after i click "Commit" button.
I don't want the "Commit" button on my screen. And i want the updates propogated to database right at the click of "Update" button.
Please suggest
Thanks & Regards
Ram
Similar Messages
-
How to use tree tables with CRUD operation for begineers ADF 11g
This is Friday night call for help.
This is only few sample ressources on the web for tree table and only one with CRUD operation.
I used this one http://jobinesh.blogspot.com/2010/05/crud-operations-on-tree-table.html because this is the only one that address CRUD.
And it is shaky. Deletion works fine but insertion not very well. This is working using custom code provided below.
Depending if the user selection in the tree, the code insert from the master node to the children node.
Any other options because it is not working well.
Also where Oracle describes how to use the row, rowset, itorator API? This is really hard to understand like almost if we should not use it.
then if not how can I insert in tree with two nodes and insert in the parent or children depending the users selection.
Lately I 'been posting questions on this forum with no response. This hurts. I understand developers cannot spend their time on this but People from Oracle, please help. We pay licenses...
public void createChildren(RowIterator ri, Key selectedNodeKey) {
final String deptViewDefName = "model.DepartmentsView";
final String empViewDefName = "model.EmployeesView";
if (ri != null && selectedNodeKey != null) {
Row last = ri.last();
Key lastRowKey = last.getKey();
// if the select row is not the last row in the row iterator...
Row[] found = ri.findByKey(selectedNodeKey, 1);
if (found != null && found.length == 1) {
Row foundRow = found[0];
String nodeDefname =
foundRow.getStructureDef().getDefFullName();
if (nodeDefname.equals(deptViewDefName)) {
RowSet parents =
(RowSet)foundRow.getAttribute("EmployeesView");
Row childrow = parents.createRow();
parents.insertRow(childrow);
} else {
RowSet parents =
(RowSet)foundRow.getAttribute("EmployeesView");
Row childrow = parents.createRow();
childrow.setAttribute("DepartmentId",
foundRow.getAttribute("DepartmentId"));
parents.insertRow(childrow);
} else {
System.out.println("Node not Found for " + selectedNodeKey);
}I am looking for a sample that describe how to design a jsf page with a tree table.
So you have Department and employees. In the tree first comes Department and if you click the node you see the employees assigned to this department.
I need to be able to insert a new department or a new employee from the tree table by clicking on a insert button in the panel collection toolbar depending on user selection in the tree.
I got part of it working but not good enough.
By problem is the get insertion working
I have a createChildren method in my AM implementation that get in input a RowIterator and selected node key.
To goal is to create new records depending of the user selection and the input parameters get populated by the binding like this:
#{backing_treeSampleBean.selectedNodeRowIterator} #{backing_TreeSampleBean.selectedNodeRowkey} via method binding with parameters.
Is it the right approach?
First to be able to insert a parent record, I select nothing in the tree and ri and selectedNodeKey comes to null
we run this code
ViewObjectImpl vo = getSchHolidaySchedExceptionsView1();
//ViewObjectImpl vo = getDepartmentsView1();
Row foundRow = vo.first();
Row childrow = vo.createRow();
vo.insertRow(childrow);
A new blank entry appears in the parent node and we enter a value.
The the problem starts when we want to add a child to this parent.
We select the created parent and press the insert button, this code get executed
if (nodeDefname.equals(deptViewDefName))
//list of the children of the parent and create an new row
RowSet childRows = (RowSet)foundRow.getAttribute("SchHolidayExceptionDatesView");
Row childrow = childRows.createRow();
childRows.insertRow(childrow);
But the new entry does not appear, it is almost like it would be created for a different parent because this is a mandatory field that is not feel in yet and the interface complaints of a missing value. It is created somewhere just not a the right place... This is my guess.
Do you see something wrong with the code?
The full code og my create children method is there below
I am using jdeveloper 11.1.1.3.0 any issues with tree table to know about with this version?
Thanks for your help
public void createChildren(RowIterator ri, Key selectedNodeKey) {
final String deptViewDefName = "com.bcferries.app.pdfroutesched.model.SchHolidaySchedExceptionsView";
final String empViewDefName = "com.bcferries.app.pdfroutesched.model.SchHolidayExceptionDatesView";
if (ri != null && selectedNodeKey != null) {
// last row
Row last = ri.last();
Key lastRowKey = last.getKey();
// if the select row is not the last row in the row iterator...
Row[] found = ri.findByKey(selectedNodeKey, 1);
if (found != null && found.length == 1) {
// foundRow is the row selected
Row foundRow = found[0];
// The row selected can be the parent node or the child node
String nodeDefname = foundRow.getStructureDef().getDefFullName();
// if parent row
if (nodeDefname.equals(deptViewDefName))
//list of the children of the parent and create an new row
//works but we try to resolve the creation of a parent
RowSet childRows = (RowSet)foundRow.getAttribute("SchHolidayExceptionDatesView");
Row childrow = childRows.createRow();
//childrow.setAttribute("HolidayDate", new java.util.Date().getDate());
System.out.println("insert child row from master");
childRows.insertRow(childrow);
} else
//RowSet ParentRow = (RowSet)foundRow.getAttribute("SchHolidaySchedExceptionsView");
//RowSet childRows = (RowSet)ParentRow.first().getAttribute("SchHolidayExceptionDatesView");
Row childrow = ri.createRow();
System.out.println("insert child row from child ");
} else {
System.out.println("Node not Found for " + selectedNodeKey);
} else {
System.out.println(" param null try creating for first row : " +
ri + " * " + selectedNodeKey);
ViewObjectImpl vo = getSchHolidaySchedExceptionsView1();
Row foundRow = vo.first();
Row childrow = vo.createRow();
vo.insertRow(childrow);
} -
Best Practice Questions: Method signature for CRUD operations
Hi,
I am reading a book about EJB3.0 which has been very helpful to me so far. However I now find myself in a dilemma which is not clearly covered in the book and I would really like to know how best to proceed. In the book it says that an Entity Manager wrapper class (responsible to handle all CRUD operations for a particular object) can have several methods. One of the methods it describes is as follows;
addUser(String username, String password, String name, String surname, etc){ ... }Note that in the above method the book does not pass the User object as a parameter to the method but rather the attributes of the User object. Therefore my first question is this;
Is there any benefit / drawback in writing the addUser(...) method in this way? or it is better to write it as follows;
addUser(User user){ ... }AS i know addUser(User user){ ... } is much more useful for several reasons:
1.Its object oriented
2.its easy to write , because if Object has many parameters its very painful to write method with comma seperated parameters -
Problem with crude operations in master detail tables
Hi,
I have Master-Detail tables in my page and crud operations are there for both the tables. Create/delete/edit are working fine on the master table but i am facing the following problems for the detail table
1.delete operation is alway referring to the 1st record.
2.Edit operation is working fine for the 1st time but when i amt trying to edit any other record it's refer to the previous record, if i did the same again then it's pointing to current record.
Selected row keys and selectionListner and row selection is defined on my detail table as shown below.
selectedRowKeys="#{bindings.CmSubscriberTerritoryXrefView1.collectionModel.selectedRow}"
selectionListener="#{bindings.CmSubscriberTerritoryXrefView1.collectionModel.makeCurrent}"
rowSelection="single"
Please do need full.Hi,
Thanks for your quick reply.
I am using JDeveloper 11g. Yes i select the record, i am using a popup for delete operation so i write a button which invoke popup in that popup i am asking confirmation like do you wanted to delete for not. in the OK button i have return logic like
BindingContainer bindings = getBindings();
OperationBinding operationBinding =
bindings.getOperationBinding("Delete2");
Object result = operationBinding.execute();
if (!operationBinding.getErrors().isEmpty()) {
return null;
operationBinding = bindings.getOperationBinding("Commit");
result = operationBinding.execute();
if (!operationBinding.getErrors().isEmpty()) {
return null;
FacesContext fc = FacesContext.getCurrentInstance(); -
hi, I am using 11g 1.2 and ADF BC
I followed the sample "http://andrejusb.blogspot.com/2010/05/crud-operations-in-oracle-adf-11g-table.html" and built a same thing in my bound task-flow.
the 'Edit' , 'Insert' , 'Save' and 'Undo' button worked perfectly, but the 'Delete' button is not. let say I have three lines in the table, If I click a row and click the 'Delete' button, then all three lines are disapear, May I know why? Thanks for your guide!
Rgds!But I do have the af:form in the page level. My table is inside the region which is in the page.
I have added a af:Subform around my af:PanelCollection, but the result is worse, even when I click 'INSERT' button, the all three lines are disapear!!!
May this sample and code can not work properly inside the region?
Edited by: xsyang on Jul 19, 2011 4:42 AM
finally I understand that the solution in the sample is for bindings in the page, but my af:table component in the page fragment. may not directly coding like sample. am i worng? can anybody guide me how to refer to binding in the fragment. Thanks!
Edited by: xsyang on Jul 19, 2011 8:06 AM -
CRUD operations and PersistenceManager close.
I have several issues which I am struggling to find the best practices for
Kodo implementation of JDO. I have a typical database schema.
Employee-Office (one-2-many), Employee-Department(one-2-many),
Employee-Projects (many-2-many).
1. What are best practices to do CRUD operations on Employee table? How
does JDO-QL queries look like? (I am new the JDO).
2. What are the best practices to do close on PM, Query, and Extent? PM
close seems to be tricky. I found a good discussion on this newsgroup
about pm.close(). As it is from 2002, would like to get latest details on
when one could reuse extent, query and pm objects and when one could do
close on them 'safely' and considered best practice?
Thank you.Vipul-
In article <c2i8u2$7v1$[email protected]>, Vipul Sagare wrote:
>
I have several issues which I am struggling to find the best practices for
Kodo implementation of JDO. I have a typical database schema.
Employee-Office (one-2-many), Employee-Department(one-2-many),
Employee-Projects (many-2-many).
1. What are best practices to do CRUD operations on Employee table? How
does JDO-QL queries look like? (I am new the JDO).I think these sorts of questions are best anwered by running through the
tutorial in the documentation. All the simple operations are
demonstrated.
If you still have questions about this after taking the tutorial, please
let us know.
2. What are the best practices to do close on PM, Query, and Extent? PM
close seems to be tricky. I found a good discussion on this newsgroup
about pm.close(). As it is from 2002, would like to get latest details on
when one could reuse extent, query and pm objects and when one could do
close on them 'safely' and considered best practice?There is some discussion of the effect of closing the PersistenceManager
at:
http://docs.solarmetric.com/manual.html#jdo_overview_pm_closing
Basically, closing a PersistenceManager should be done once you no
longer need to use any of the objects that may have been obtained from
the PersistenceManager. Note that Kodo will close discarded
PersistenceManagers automatically for you eventually, but it is
sometimes wise to do it yourself to conserve resources.
Marc Prud'hommeaux [email protected]
SolarMetric Inc. http://www.solarmetric.com -
CRUD Operations using Servlets , SessionBeans and JPA
Hi
Please tell me what will be the right approach for doing CRUD operations .
I have a jsp page with which the user interacts.
Please tell me the right approach here :
Option 1 :
JSP --->Servlet--->SessionBean--->JPA.
JSP Page submits data to the servlet , the servlet looks up for the SessionBean , and the sessionBean consists of the container EntityManager , for persist , delete , and finding .
Option 2 :
JSP --->Servlet-->JPA.
The Jsp page submits to servlets and the Servlet itself consists of the container EntityManager , for persist , delete , and finding .Depends on the reusabiltity of the query really. If you have a single database query that is used in multiple places, then by all means put it in a session bean. But if you only do persist/delete operations, then just use the EntityManager directly. The session bean would just be an extra layer of complexity that you don't need.
-
Cnsuming Lightswitch Odata service in c# winform to perform crud Operations
HI
I have created light switch html application which is having sql as datasource.
I want to consume the Odataservices that will be created from light switch in c# winforms to perform crud operations .
Can any one help me how to handled crud operations.
Thanks and regards
VenkatI found:
https://social.msdn.microsoft.com/Forums/en-US/71338428-faa6-4e2f-87fb-5ef86f02c69d/how-to-consume-odata-service-made-in-lightswitch-in-a-windows-forms-application?forum=LightSwitchDev11Beta
https://msdn.microsoft.com/en-us/library/hh973174.aspx
and a bunch more when I googled "windows forms consuming lightswitch odata"
These are REST services
http://blogs.msdn.com/b/bethmassi/archive/2012/03/09/creating-and-consuming-lightswitch-odata-services.aspx
If you google "windows forms consuming rest services" there are a stack more hits.
http://www.codeproject.com/Questions/648106/Consuming-REST-WCF-Service-in-Windows-Forms-Applic
http://www.c-sharpcorner.com/UploadFile/rahul4_saxena/create-and-consume-wcf-restful-service/
I would recommend you create a "proper" wcf data service rather than using a lightswitch one.
Hope that helps.
Recent Technet articles: Property List Editing;
Dynamic XAML -
Hi All,
I am working on the crud operations of the swing textfields using javafx. when the user clicks on the Edit button, the fields should be enabled for updating and after edit is finished , the textfields should be updated with the new data. I also have a reset button to reset information in textfields . Could someone help me by providing some examples.
Regards,
SherlynMaybe the [JavaFX CRUD|http://www.learntechnology.net/content/javafx/javafx.jsp] article might interest you.
-
Our data sources are as follows:
- An mdb file (downloaded every hour)
- Multiple xls files (downloaded every week)
Our aim is to develop a BI solution using BISM, Data Mart, OLAP cubes etc.
From my understanding, we do not necessarily require an OLTP DB and we can import our data directly into our data mart using SSIS.
- However, with a data mart, will we be able to perform CRUD operations on all our data just like an OLTP DB?
Thanks.Hi Darrenod,
Thank you for your question.
I am trying to involve someone more familiar with this topic for a further look at this issue. Sometime delay might be expected from the job transferring. Your patience is greatly appreciated.
Thank you for your understanding and support.
Regards,
Charlie Liao
TechNet Community Support -
Can I do CRUD operation on a businessview object using RAS SDK.or BO SDK?
I want to add a filter to my businessview using BO SDK or RAS SDK. and also want to do some CRUD operations on businessview uisng SDK. is there any way to add a filter to business view using RAS SDK?
I can get the businessView and set it as a datasource to ReportClient Document. now I want to add a filter to businessView and save the modification.
please refer the code for better clarity.
ISessionMgr sessionMgr = CrystalEnterprise.getSessionMgr();
IEnterpriseSession enterpriseSession = sessionMgr.logon(
"Administrator", "amam!984", "cura-ws-78:6400",
"secEnterprise");
IInfoStore iStore = (IInfoStore) enterpriseSession
.getService("InfoStore");
IInfoObjects infoObjects = iStore
.query("Select * From CI_APPOBJECTS where SI_NAME='BusinessViewName'");
IInfoObject infoObject = (IInfoObject) infoObjects.get(0);
IReportAppFactory reportAppFactory = (IReportAppFactory) enterpriseSession
.getService("RASReportFactory");
ReportClientDocument rcd = new ReportClientDocument();
rcd= reportAppFactory.newDocument(null);
rcd.getDatabaseController().addDataSource(infoObject);
After this can I add a filter to the businessview here?
All the reply are highly appreciated and thanks in advance to all for sharing knowledge.
Regards,
Sunil Kumar SahooThere's currently no public SDK for CRUD of Business Views.
Sincerely,
Ted Ueda -
Perform CRUD operation on List using Gridview control (SharePoint Visual webpart)
Hi Friends,
I have SharePoint Visual webpart and I want to perform CRUD operation on SharePoint list using Gridview control.
Is there any other way to implement it , please suggest me the solution approach.
Thanks,
Digambar KashidIs there any specific reason you dont want to use Out Of the Box list CRUD operation? Anyways, if you want to use custom approach I think SPGridView is good approach.
There are some samples available for what you are trying to achieve.
Samples on how to use SharePoint's GridView
Also There is similar thread which might be helpful as well.
http://social.msdn.microsoft.com/Forums/en-US/7b4f69e9-36b5-4188-8b75-1f727d0bb594/is-there-any-posibility-to-do-crud-operations-with-gridview-control?forum=sharepointdevelopmentprevious
Amit -
CRUD operation return messages thru the web services
Hello,
I am creating some webservices which exposes the CRUD operations. Now when I am invoking these operations e.g. delete, update, it does not return proper messages when the record gets deleted or updated.
Can anyone pls let me know what I need to do to return more meaningful message to the user ?
Thanks in advance.
RanjanHello,
I am creating some webservices which exposes the CRUD operations. Now when I am invoking these operations e.g. delete, update, it does not return proper messages when the record gets deleted or updated.
Can anyone pls let me know what I need to do to return more meaningful message to the user ?
Thanks in advance.
Ranjan -
ExceptionInInitializerError when trying a CRUD operation
Hi Forum,
I'm fairly a new kodo user. I created mapping for my objects and upon running the application I see the following error. It happens whenever I try to attempt any CRUD operation. Has anyone seen this before?
TIA
java.lang.ExceptionInInitializerError at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:242) at kodo.jdbc.meta.Mappings.forFieldMappingName(Mappings.java:734) at kodo.jdbc.meta.Mappings.newFieldMappingInstance(Mappings.java:722) at kodo.jdbc.meta.RuntimeMappingProvider.getFieldMapping(RuntimeMappingProvider.java:207) at kodo.jdbc.meta.MappingRepository.getFieldMapping(MappingRepository.java:470) at kodo.jdbc.meta.AbstractClassMapping.getFieldMapping(AbstractClassMapping.java:993) at kodo.jdbc.meta.AbstractClassMapping.getFieldMapping(AbstractClassMapping.java:973) at kodo.jdbc.meta.AbstractClassMapping.getMappings(AbstractClassMapping.java:939) at kodo.jdbc.meta.AbstractClassMapping.getDeclaredFieldMappings(AbstractClassMapping.java:659) at kodo.jdbc.meta.AbstractClassMapping.resolve(AbstractClassMapping.java:801) at kodo.jdbc.meta.BaseClassMapping.resolve(BaseClassMapping.java:347) at kodo.jdbc.meta.MappingRepository.resolve(MappingRepository.java:431) at kodo.jdbc.meta.MappingRepository.getMapping(MappingRepository.java:349) at kodo.jdbc.meta.MappingRepository.getMapping(MappingRepository.java:177) at kodo.jdbc.meta.MappingRepository.getMetaData(MappingRepository.java:165) at kodo.runtime.PersistenceManagerImpl.makePersistent(PersistenceManagerImpl.java:2718) at kodo.runtime.PersistenceManagerImpl.makePersistent(PersistenceManagerImpl.java:2670) at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:92) at org.springframework.orm.jdo.JdoTemplate$9.doInJdo(JdoTemplate.java:396) at org.springframework.orm.jdo.JdoTemplate.execute(JdoTemplate.java:260) at org.springframework.orm.jdo.JdoTemplate.makePersistent(JdoTemplate.java:394) atYou can only make an HTTPS connection if the SWF was also
loaded via HTTPS. -
Hi every body
I'm looking for example (CRUD) using business component And embedded operations.
If there are any links or tutorials thats will help
Note:I'm using JDeveloper 11g version 11.1.1.3
THANKSShay, sorry I should have been clearer, but your "immediate=true" statement helped me work through a solution.
Your proposal refreshes the new part form to its default setting (i.e. The form as it appeared when you first load the create new part page).
To remove the created row, bypass the validation, and return to the previous page (browseOrders.jsff) ... is there a simple way (Declarative) to do this?
For this simple example, I had to ...
<ol>
<li>Create a managed bean in the orders-flow.xml in pageFlow scope.</li>
<li>In browseOrder.jsff, modify the Edit Orders and New Order buttons to accept an action defined in the bean which</li>
a) Saved the current iterator's key
b) Called the Create function (or not in the case of the edit button)
c) returned the name of the view Control Flow Case "goEdit"
<li>In editOrders.jsff, add a button called Return. Set its immediate property = true to bypass validation</li>
<li>Modify it so that it accepted an action which</li>
a) Called the Rollback function
b) Set the current iterator's key to the previously saved state
c) Refreshed the panel form layout using AdfFacesContext
d) Returned the name of the view Control Flow Case "goBrowse"
</ol>
I've repeatedly read it's much better to be declarative as opposed to progamming if possible. But is it possible?
Maybe you are looking for
-
This is my first time using this site, but it's helpful so far. Not sure if I need to retype the wording in the Discussion box above, but will do so just in case. Love Safari's new look, but on my 17-inch MacBook Pro the font on most pages is partly
-
Hello all, I have an requirement that i hav to put one validation while creating limit shopping cart. I'm using BADI BBP_DOC_CHECK_BADI for this. My issue is that after error is occured and user wants to correct that error. Again my code gets execute
-
Adding multiple states in state machine
Hi all, I have a state machine with many states. I am using an enum to select state. I didn't add all the state in the enum at the beginning, so I am adding more statess to the enum and to the state machine as I go. I found the following pretty tr
-
Connecting Thinkpad Yoga to Dual VGA Monitors
I recently received my Thinkpad Yoga, and would like to connect it to dual external monitors (I will only be using those two monitors, not the laptop monitor) that both have VGA connectors. My original thought was to get the Thinkpad Onelink Pro Dock
-
Passing a class to a method?
This doesn't work: public Decorator findDecorator(String className) { if (this instanceof className) return this; else return null; }My friend told me that in C# he just does this: findDecorator(Type className)So how do I do i