How to do single-table inheritance when discriminator is in another table?
Suppose you have a table called PERSONS and it stores entities which you want to model via various subclasses of Person based on a simple discriminator column OCCUPATION: "D"=>Doctor, "L"=>Lawyer, etc. So far so good.
Now suppose that the DBA is going to remove the OCCUPATION column and replace it with a column called OCODE, where "01"..."50"=>Doctor, "51"..."70"=>Lawyer, etc. There will be a second table, OCODE_TO_OCCUPATION, which can be used via a join to recover the old OCCUPATION column in SQL.
From the DBA's perspective, everything is fine. From mine, it breaks EJB3's ability to map the table's contents into object of the appropriate classes. It seems like EJB3 would need to support one of the following:
(1) Multiple discriminator values per class ("01".."50" => Doctor, etc.).
(2) Ability to provide my own object factory so that I can do the OCODE-to-OCCUPATION mapping myself.
(3) Ability to use a view which provides the discriminator column when querying, while still using the real table for insert/update/delete.
Is there a way I can get the old class structure given the new table structure?
As I understand it, you can have exactly ONE discriminator value per class. I'm certainly not going to define 100 classes. There are 50 discriminator values that map to class "Doctor".
Similar Messages
-
Adding a single table without a logical join to another table (OBIEE 10g)
Sometimes I want to just display a single table without a logical join to another table in the repository. However, everytime I move it to the Business Model and Mapping layer and perform a Global Consistency Check, it tells me that it needs a logical join and I am forced to create another table to join to it. Thus creating a dimension-fact relationship. There are times I don't need this relationship and just want to display some data. Is there anyway to get around this?
Thanks in advance!Yes,You have to create a join.You cannot take single table to BMM layer.You can create an alias of the table.Join this alias and base table through any common column and take both tables to BMM and desired table to presentation layer.
Another way is to create a view in physcial layer.Write a select statement like
Select primary_key from Table
Where primary_key is primary key of base table.Join this view ith base table and repeat the steps defined for Alias.
Regards,
Sandeep -
How to make validation in Bean and select value from another table
I want to know how to select data from table in backing bean according to primary key i have
the problem is that
i have a table Employee_Salary contains Employee ids and their salary
Empoloyee_Salary table
Employee_ID Number
Employee_salary Number
And Another table Called Employees
Employees table
Employee_ID Number
IsManager Varchar2 its value is [*Yes or NO*]
and other columns that i don't care about this table
i have on a jsff page an <af:table> this table is editable this is the Empoloyee_Salary table
*i want to check before save or after insert if this employee is Manager [from Employees tabke(yes or no)] the salary*
cannot be less that 100
i want to know how to make this how to select the value from employees table according to the id i have in the employee_salary table how to make this and make this validation
i have to select IsManager from Employees Table to see if this manager or no
i want to know how to make this in a bean
i use jdeveloper 11g
and my project is ADF Fusion project
and the page that have the Emplpyee_Salary table is JSFF
thanks in advanceYou might want to write this code in a validator on the entity object if it should apply from every screen.
If you want to access view objects from a backing bean the basics are here: http://download.oracle.com/docs/cd/E15523_01/web.1111/b31974/bcservices.htm#sthref918 -
How to see the pass folios when log in to another cell phone or iPad
how to see the pass folios when log in to another cell phone or iPad
You need to log into the content viewer with the same Adobe ID you used to create the folio. Note: iPad folios will not appear on the iPhone but should be available on all other devices.
-
How to dynamically display the data from a table base on row selection of another table in ADF
Hi ,
I have a requirement in ADF. I need to change the data of a table based on row selection of another Table . Both the table have a Parent Child relationship between them. They have a common attribute say department_id.
For this I created bind variable in view object of employees table and wrote a where clause in the sql query using that bind variable. Then I created method for selection listener of department Table in java bean.
My method is following
public void onrowselection(SelectionEvent selectionEvent) {
RichTable richTable = (RichTable)selectionEvent.getSource();
CollectionModel tableModel = (CollectionModel)richTable.getValue();
JUCtrlHierBinding adfTableBinding = (JUCtrlHierBinding)tableModel.getWrappedData();
Object selectedRowData = richTable.getSelectedRowData();
JUCtrlHierNodeBinding nodeBinding = (JUCtrlHierNodeBinding)selectedRowData;
oracle.jbo.domain.Number newVal = (oracle.jbo.domain.Number) nodeBinding.getAttribute("DepartmentId");
Number pallet = newVal.bigDecimalValue();
System.out.println("Selected values " + pallet);
BindingContext bindingctx = BindingContext.getCurrent();
BindingContainer bindings = bindingctx.getCurrentBindingsEntry();
DCBindingContainer bindingsImpl = (DCBindingContainer) bindings;
DCIteratorBinding dciter = bindingsImpl.findIteratorBinding("EmployeesView1Iterator");//access the iterator by its ID value in the PageDef file
ViewObject vo =dciter.getViewObject();
vo.setNamedWhereClauseParam("DepartmentId", pallet);//enter your value
vo.executeQuery();
It is printing the selected value of department id from department table in the log. But it is not able to pass the value to employees view. It is showing the following error in the log
"Definition DepartmentId of type Variable is not found in EmployeesView1."
I will be very thankful if someone helps me to solve this errror or is there any other way to achieve the same requirement.
Thanks
NileshNote quite sure why you simply wont create a viewlink for the viewobject the tables are based on..
The viewlink attribute will be based on the departmentId and it's a simple master detail relationship which automatically uses ppr.
However, if both tables are on the same page; using your hack about;
On the underlying viewobject, define a viewcriteria e.g. "listById" and set your bind variable here.
I would bind table two to a RichTable component:
RichTable t2;
public void onrowselection(SelectionEvent selectionEvent) {
RichTable richTable = (RichTable)selectionEvent.getSource();
CollectionModel tableModel = (CollectionModel)richTable.getValue();
JUCtrlHierBinding adfTableBinding = (JUCtrlHierBinding)tableModel.getWrappedData();
Object selectedRowData = richTable.getSelectedRowData();
JUCtrlHierNodeBinding nodeBinding = (JUCtrlHierNodeBinding)selectedRowData;
oracle.jbo.domain.Number newVal = (oracle.jbo.domain.Number) nodeBinding.getAttribute("DepartmentId");
Number pallet = newVal.bigDecimalValue();
System.out.println("Selected values " + pallet);
refreshTable2(pallet);
BindingContext bindingctx = BindingContext.getCurrent();
BindingContainer bindings = bindingctx.getCurrentBindingsEntry();
DCBindingContainer bindingsImpl = (DCBindingContainer) bindings;
DCIteratorBinding dciter = bindingsImpl.findIteratorBinding("EmployeesView1Iterator");//access the iterator by its ID value in the PageDef file
ViewObject vo =dciter.getViewObject();
vo.setNamedWhereClauseParam("DepartmentId", pallet);//enter your value
vo.executeQuery();
private void refreshTable2(Number pallet){
RichTable x=getT2();
CollectionModel cm=(CollectionModel)x.getValue();
JUCtrlHierBinding jcb=(JUCtrlHierBinding)cm.getWrappedData();
BindingContainer bindings = bindingctx.getCurrentBindingsEntry();
DCBindingContainer bindingsImpl = (DCBindingContainer) bindings;
DCIteratorBinding dciter = bindingsImpl.findIteratorBinding(jcb.getName()+"Iterator");
ViewObject vo =dciter.getViewObject();
ViewCriteriaManager vcm=vo.getViewCriteriaManager();
ViewCriteria vc=vcm.getViewCriteria("listById");
vo.applyViewCriteria(vc);
vo.setNamedWhereClauseParam("DepartmentId",pallet);
vo.executeQuery();
AdfFacesContext.getCurrentInstance().addPartialTarget(getT2()); -
I need to copy data from a table in one database (db1) to another table in
Hi
I need to copy data from a table in one database (db1) to another table in another database (db2).
I am not sure if the table exists in db2,,,if it doesnot it needs to be created as well data also needs to be inserted...
How am I supposed to this using sql statements..?
I shall be happy if it is explained SQL also...
Thanking in advanceHow many rows does the table contains? There are manyway you can achieve this.
1. export and import.
2. create a dblink between two databases and use create table as select, if structure doesnot exists in other database, if structure exists, use, insert into table select command.
example:
create a dblink in db2 database for db1 database.
create table table1 as select * from table1@db1 -- when there is no structure present
-- you need to add constraints manually, if any exists.
insert into table1 select * from table1@db1 -- when there is structure present.
If the table contains large volume of data, I would suggest you to use export and import.
Jaffar -
How do I execute some code when a line of a table control is selected?
Hi,
I would like to execute some code when a line of a table control is selected. At the moment I have to select one or multiple rows and then press enter, this forces a screen refresh and my code is executed but I would like the code to be executed as soon as any line is selected.
I've done something like this using ALV grids and object orientated code but is there a way of doing this in a normal non-OO table control?
Thanks in advance.
GillHi,
U need to declare a char1 field for marking (mark field). This will reflect with value 'X' in your tcontrol internal table for all the selected rows.
Now u need to handle the okcode for enter in your PAI.
There u need to loop through the table for all marked fields.
There after u can do what ever u want.
Venkat. -
Hi All,
Am using OPENROWSET to load the file data into table, here the problem is i need to map same input value to two different columns of table, As format file doesn't allow the duplicate numbers am unable to insert same value to two columns, please help me to
find a solution for this.
i can use only OPENROWSET because i need to insert some default values also which come based on file. only the problem is how to map same input value to two different columns of table. please give me the suggestions.
Thanks,
SudhakarFrom what you say:
INSERT tbl(col1, col2)
SELECT col1, col1
FROM OPENROWSET(....)
But I guess it is more difficult. You need to give more details. What sort of data source do you have? What does your query look like? The target table?
Erland Sommarskog, SQL Server MVP, [email protected]
Hi Erland,
Thanks for your response
my source file is text file with | symbol separate for ex:
1002|eTab |V101|eTablet|V100|Logic|LT-7|Laptops|SCM
Database table have columns like
column1,column2,column3...etc, now i need to insert same value from input file into two columns for ex:
the eTab value from text file has to be insert into column2 and column3 of
table
we cannot change format file like below one
for the above situation how can we insert eTab into column2 and column3
Thanks,
Sudhakar. -
Remove row from table when adding values to another table
hi am adding value programticaly how can i remove the row i just add from the table
this is how am adding value
public void addMember(javax.faces.event.ActionEvent actionEvent) {
List<String> tempTable = new ArrayList<String>();
//Code to get the bindings for TargetVO :
RowKeySet selectedEmps = getEmpTable().getSelectedRowKeys();
Iterator selectedEmpIter = selectedEmps.iterator();
DCBindingContainer bindings =
(DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding empIter = bindings.findIteratorBinding("UserDetailsViewVO1Iterator");
RowSetIterator empRSIter = empIter.getRowSetIterator();
while(selectedEmpIter.hasNext()){
Key key = (Key)((List)selectedEmpIter.next()).get(0);
Row currentRow = empRSIter.getRow(key);
onRowCreate(currentRow);
boolean b = selectedEmps.remove(currentRow);
i what to clear the row i just selected from the table
AdfFacesContext.getCurrentInstance().addPartialTarget(empTable);
// empTable
public void onRowCreate( Row currentRow ) {
BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
//access the name of the iterator the table is bound to.
DCIteratorBinding dciter = (DCIteratorBinding) bindings.get("addmemberBeanIterator");
//access the underlying RowSetIterator
RowSetIterator rsi = dciter.getRowSetIterator();
//get handle to the last row
Row lastRow = rsi.last();
//obtain the index of the last row
int lastRowIndex = rsi.getRangeIndexOf(lastRow);
/*check if the user is added already*/
/*OperationBinding oper2 = (OperationBinding) bindings.get("check if user exists method binding");
oper2.getParamsMap().put("attributeName1", uniqueUserAttributeValue);
Object ret = oper2.execute();*/
//create a new row
Row newRow = rsi.createRow();
String f = (String)currentRow.getAttribute("Firstname");
String s = (String)currentRow.getAttribute("Surname");
String u = (String)currentRow.getAttribute("Username");
String n = (String)currentRow.getAttribute("Emailaddress");
// String orgid = (String)currentRow.getAttribute("Organisationid");
newRow.setAttribute("firstname", f);
newRow.setAttribute("surname", s);
newRow.setAttribute("name", u);
newRow.setAttribute("emailaddress", n);
// newRow.setAttribute("Organisationid1",orgid);
//initialize the row
newRow.setNewRowState(Row.STATUS_INITIALIZED);
//add row to last index + 1 so it becomes last in the range set
rsi.insertRowAtRangeIndex(lastRowIndex +1, newRow);
//make row the current row so it is displayed correctly
rsi.setCurrentRow(newRow);
System.out.println("Username " + u);
System.out.println("firstname " + f);
System.out.println("surname " + s);
System.out.println("email " + n);
// refereshpage();
// return null;
am in jdevloper 11.1.1.6.0
my table is
public void onRowCreate( Row currentRow ) {
BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
//access the name of the iterator the table is bound to.
DCIteratorBinding dciter = (DCIteratorBinding) bindings.get("addmemberBeanIterator");
//access the underlying RowSetIterator
RowSetIterator rsi = dciter.getRowSetIterator();
//get handle to the last row
Row lastRow = rsi.last();
//obtain the index of the last row
int lastRowIndex = rsi.getRangeIndexOf(lastRow);
/*check if the user is added already*/
/*OperationBinding oper2 = (OperationBinding) bindings.get("check if user exists method binding");
oper2.getParamsMap().put("attributeName1", uniqueUserAttributeValue);
Object ret = oper2.execute();*/
//create a new row
Row newRow = rsi.createRow();
String f = (String)currentRow.getAttribute("Firstname");
String s = (String)currentRow.getAttribute("Surname");
String u = (String)currentRow.getAttribute("Username");
String n = (String)currentRow.getAttribute("Emailaddress");
// String orgid = (String)currentRow.getAttribute("Organisationid");
newRow.setAttribute("firstname", f);
newRow.setAttribute("surname", s);
newRow.setAttribute("name", u);
newRow.setAttribute("emailaddress", n);
// newRow.setAttribute("Organisationid1",orgid);
//initialize the row
newRow.setNewRowState(Row.STATUS_INITIALIZED);
//add row to last index + 1 so it becomes last in the range set
rsi.insertRowAtRangeIndex(lastRowIndex +1, newRow);
//make row the current row so it is displayed correctly
rsi.setCurrentRow(newRow);
System.out.println("Username " + u);
System.out.println("firstname " + f);
System.out.println("surname " + s);
System.out.println("email " + n);
// refereshpage();
// return null;hi,
make the table selection single and use this links 4 ur task.
http://www.baigzeeshan.com/2010/06/deleting-multi-selected-rows-from-adf.html
http://deepakcs.blogspot.com/2013/01/ejb-dc-deleting-multi-selected-rows.html
https://forums.oracle.com/thread/2534813
https://blogs.oracle.com/jdevotnharvest/entry/iterating_selected_rows_in_an
txs -
How can destroy Java Plug - in when i jump to another page without Applet
When I jump to another HTML page, that not include <Applet> </Applet> tag, the Java Plug-in does not exit and use system's resource. I don't want it make my computer run slow then I want sutdown the Java Plug-in when I stop the page, that have an Applet.
Hi dekassequi:
Sorry if I misunderstood the problem......I've never tried swing set because it requires the JVM plugin. All my applets are non-swing and I've noticed that frequently when I exited the browser, it would be stuck in a never-never land requiring ALT-CTRL-DEL to end the browser's task. By overriding the destroy a the call to system.exit seems to have solved my problem -- if there is any error message in the system console, it is not noticeable because it disappeared instantenousely when the browser's own JVM is used.... Besides, destroy is the last thing an applet does anyway....without looking at Java source code, I can only surmise that that's what it does
As a matter of fact, I've just tried to write some stupid swing applet but I've noticed that one cannot really script an applet that requires a Sun JVM. Here is a link, perhaps you can take a quick look and see if I'm doing something wrong.
http://home.attbi.com/~aokabc/test/test2.htm
BTW, I did notice late last night that overriding the destroy method in an applet that requires a JVM plugin does give an error message in the system console which takes a bit longer to close but you know what, at least it got rid of the console afterward -- otherwise, the console just sit in the tray and ALT-CTRL-DEL can't even get rid of it. In the mean time, I'll simply remove the system.exist(0) and leave a skeleton destroy method and see if the JVM console still sit in the system tray.
Regards,
V.V. -
Need help in SQL Query: Update a row in a table & insert the same row into another table
I want to update a row in a table say Table A and the updated row should be inserted into another table say Table B. I need to do it in a single SQL query and i don't want to do it in PL/SQL with triggers. And i tried with MERGE statement but its working with this scenario. (Note: I'm using Oracle Database 10g Enterprise Edition Release 10.2.0.1.0).
Thanks in Advance.Using Sven's code as an example, you could save the updated row in a sql plus variable. (also untested):
SQL> var v_id number
update tableA
set colB='ABC'
where colC='XYZ'
returning id into :v_id;
insert into table A_History (ID, colA, colB, ColC)
select id, ColA, ColB, ColC
from tableA
where id = :v_id; -
Hello,
I was wondering if it's possible have a matrix which shows total credits by month and have drill-down groupings to display the invoice numbers for each credit. Then, once the drill-down is expanded for a particular month, be able to click on the invoice
number and have another table under the matrix display the details of the invoice.
I don't really want a drill-through because that opens a different report in the window, what I want to be able to do is stay on the main report. I also don't want to drill-into the invoice details from the matrix as that expands the matrix out and
makes it unruly and ugly. I've been playing with subreports but not able to get what I want out of it.
I hope this makes sense - is there a way to do this in SSRS?
Thanks!!Hi AvenueStuart,
After testing the issue in my environment, we can refer to the steps below to work around the issue:
Create a new table with the details of the invoice under the matrix.
Add a parameter named invoice which get available values from the invoice field in the dataset.
Right-click the [Sum(invoice)] cell to add an action with “Go to report” option, and specify the same report with the parameter below:
Name: invoice
Value: [invoice]
Right-click the table to add a filter in the table:
Expression: [invoice]
Operator: =
Value: [@invoice]
If there are any misunderstanding, please elaborate the issue for further investigation.
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
Deleting rows from one table while filter condition lies into another table
Hi All,
I'm facing a problem deleting a row from a table where the condition lies in other table. To ealaborate the scenario further let's say I have two table T1 (transaction table) and T2 (Master Table). I want to delete a record from table T1 by checking some conditions lies in table T2.
I tried with the below query but this query deleting records from both the table.
DELETE FROM ( SELECT * FROM T1 top INNER JOIN T2 tp
ON top.TID = tp.TID
WHERE top.DEAL_SITE_ID = inputparameter1
AND (TP.SEGMENT <>inputparameter2 OR tp.segment is not null));
Here the record is getting deleted from both the tables but I don't want to delete data from my master table i.e table T2.
Any help would be highly appreciated. Thanks in advance.
Regards,
SubhadeepSQL> select *
2 from the_table;
X Y
AA a
BB a
CC a
AA b
DD b
SQL> select *
2 from the_table_2;
X Y
AA a
BB a
CC a
SQL> delete from
2 (
3 select *
4 from the_table t1 inner join the_table_2 t2
5 on t1.x = t2.x
6 and t1.y = t2.y);
3 rows deleted.
SQL> select *
2 from the_table;
X Y
AA b
DD b
SQL> select *
2 from the_table_2;
X Y
AA a
BB a
CC a -
Generate xml from a table and insert the xml into another table
I want to generate an xml file from a table and insert it into another table all in one tsql
insert into table B(xmlfile)
select * from tableA
FOR
XML
PATH('ac'),TYPE,ELEMENTS
XSINIL,ROOT('Accum')
Is not working any helpI have solved my issue all I did was to change my column datatype to xml
-
Dreamweaver 8 - Height of tables keeps changing when images added to another table
Greetings! i have a rather annoying problem on my hands with
dreamweaver.
Currently for a small college project i am being asked to
design a small yet effective website to show students in the future
what will be expected.
So i've drawn up my template etc etc and all was going
well.... i created a table with 2 columns, 1 row on the right side
(where information shall be written) and 7 on the left hand column.
At the very top of the left hand column i have a 250x250
image and the other columns house several Sub links.
Now upon typing information in the right hand column
everything went well when browsing.....i then added pictures to the
right hand column that will be clickable links for
enlargements....of which dreamweaver had a small hissy fit and
stretched the left hand columns 90% down the total width of the
page....which a simple click on the border line solved and
everything went back to proportion. BUT what i get when browsing is
completley baffeling! Several of the left hand rows are stretched
like crazy! and i havent a clue why! some screen shots will be
viewable below...but i was wondering if any folk out there with any
information into solving this problem could help!
This is the dreamweaver view
http://i37.photobucket.com/albums/e92/Kaoscontrol/Dreamweaverview.jpg
And this is the browser view i get on every computer i've
tried it on
http://i37.photobucket.com/albums/e92/Kaoscontrol/Browserview.jpg
If there is anyone that can help me out it would be greatley
appretiated.
Many thanks
JamesTry changing this -
action="Mailto: [email protected]"
to this -
action=''Mailto:[email protected]''
I am doubtful that this will help, but give it a try.
You do know how unreliable that method is, right?
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
==================
"alpha911" <[email protected]> wrote in
message
news:fit4am$nq7$[email protected]..
> this is the script for the problem i am having. I am not
getting any
> email
> when someone press send
> <form name="frmsendmail" method="POST" >
onSubmit="return
> ValidationForm()">
> <table width="80" height="386" border="0"
align="center">
>
> <tr>
> <td width="105"> </td>
>
> <td width="327"> </td><tr>
> <td> </td>
> <td> </td></tr>
> <td align="right" class="text">Name :
> <td><div align="left">
> <input name="txtEmailfrm2" type="text" class="input"
> id="txtEmailfrm22" size="30" maxlength="100">
> </div>
> <tr>
> <td align="right" class="text">Email :
> <td><div align="left">
> <input name="txtEmailfrm2" type="text" class="input"
> id="txtEmailfrm22" size="30" maxlength="100">
> </div>
> <tr>
> <td align="right" class="text">Subject :
> <td><div align="left">
> <input name="txtSub2" type="text" class="input"
id="txtSub22"
> size="30" maxlength="100">
> </div>
> </tr>
> <tr>
> <td align="right" class="text">Mesage(body) :
> <td><textarea name="txtMsg" cols="50" rows="10"
class="input"
> id="textarea"></textarea>
> </tr>
> <tr>
> <td align="right">
> <div align="right">
> <input name="hidsubmit" type="hidden" id="hidsubmit"
> value="true">
> <input name="Submit" type="submit" class="input"
> value="Send">
> </div>
> <td><div align="left">
> <input name="Submit2" type="reset" class="input"
> value="Reset">
> </div>
> </tr>
> </table>
> <body>
> </form>
>
Maybe you are looking for
-
Deleting blank pages in PDFs automatically
Greetings. We have a Ricoh Multipurpose scanner that scans documents to a network folder as a PDF. Because there are a mix of Duplex and single page original documents, blank pages are created in some of the PDFs. Our staff has been manually deleting
-
Publication Service available in template VM?
Hello, We have installed the patch Patch 8919063 (Oracle Product Hub for Communications, Release 12.1.1) on the applications tier VM. Afterwards we have followed the post installation steps of the patch (Document ID 885359.1). This document refers to
-
Dear Team, During DB13 full offline backup+redolog backup I am facing the error.At the time of backup it run near about one and half hour. But after that it give error. BR0201I Compressing /oracle/PRD/sapdata1/sr3700_2/sr3700.data2 BR0203I to /oracle
-
SC with awaiting approval status and no work item for Approvers.
Hi Experts, We are implementing Classic scenario with SRM7.0 and we are having Application controled Workflow. We are fasing issue in workflow. On SC getting ordered the status is showing as awaiting approval and there is no work item found in BBP_PD
-
After getting 4G with AT&T I am unable to join my network and get the error message: Unable to join the network "Jude". How do I fix this? Thank yo