Object type mappings in expression builder
Hi,
I'm trying to use expression builder to give me a query returning all instances of an object with a particular foreign key, and where 'active' = true.
'active' is a CHAR field in the database with values 'T' or 'F' and this is mapped to a Boolean in workbench as true and false.
All works fine in normal operations, retrieving and writing the data.
I've written the expression as
myId EQUAL arg
AND
active EQUAL 'true'
where 'true' is a literal of type Boolean.
Unfortunately, running this query generates an error that no mapping exists for 'true'.
I've also tried changing it to
active EQUAL 'T'
where 'T' is a literal of type String.
This also generates an error.
It seems to me as though the object type mapping is confusing the expression builder and it can't generate the sql correctly.
Any ideas?
Can you post the specific version of TopLink, the exact code you are using to construct and execute your query, as well as the error message with stack trace. With these items we should be able to provide an answer for you.
Doug
Similar Messages
-
Expression or Function as field in Object Type
I am trying to use an expression or call a function as a return value for a field in an OBJECT TYPE.
Here's the obj def:
CREATE OR REPLACE TYPE OUTAGE_REPEAT_CALL_T2 AS OBJECT (
INITCALL_TS DATE,
LASTCALL_TS DATE,
CALL_SRC CHAR(8),
ELAPSED_TIME NUMBER,
REP_ID CHAR(8),
CALL_CNT NUMBER(3)
The ELAPSED_TIME field should be the differnece in minutes from the LASTCALL_TS and SYSDATE...
I'm not sure how to select into this OBJECT to get my result...
Sample table and data:
SQL> desc oms.outage_repeat_call
Name Null? Type
ACCT NOT NULL NUMBER(10)
INITCALL_TS NOT NULL DATE
LASTCALL_TS NOT NULL DATE
CALL_CNT NOT NULL NUMBER(3)
CALL_SRC NOT NULL CHAR(8)
REP_ID NOT NULL CHAR(8)
The ELAPSED_TIME is not part of the underlying table..
sample data from tbl:
ACCT INITCALL_ LASTCALL_ CALL_CNT CALL_SRC REP_ID
123456 02-JAN-02 02-JAN-02 1 CBIS MJB2302
I want to have this as a result:
INITCALL_ LASTCALL_ CALL_SRC ELAPSED_TIME REP_ID CALL_CNT
02-JAN-02 02-JAN-02 CBIS 9997 MJB2302 1
But by doing a select from the OBJECT TYPE:
i.e.
SELECT OUTAGE_REPEAT_CALL_T2( ORPC.INITCALL_TS,
ORPC.LASTCALL_TS,
ORPC.CALL_SRC,
'expression or func' AS ELAPSED_TIME,
ORPC.REP_ID,
ORPC.CALL_CNT)
FROM
OMS.OUTAGE_REPEAT_CALL ORPC
WHERE
ORPC.ACCT=123456;
I am using DBMS_XMLQUERY to eventually get this:
<?xml version = '1.0'?>
<ROWSET>
<ROW num="1">
<INITCALL_TS>1/2/2002 12:45:0</INITCALL_TS>
<LASTCALL_TS>1/2/2002 12:45:0</LASTCALL_TS>
<CALL_SRC>CBIS </CALL_SRC>
<ELAPSED_TIME>10009</ELAPSED_TIME>
<REP_ID>MJB2302 </REP_ID>
<CALL_CNT>1</CALL_CNT>
</ROW>
</ROWSET>
Here's the real query... this OBJECT TYPE is embedded as an attribute of another OBJECT TYPE def.
sQuery := 'SELECT '
|| iNumAcct || ' AS NUMACCT,
SITE_T(S.ACCT,
S.SITE,
S.PHONE,
S.CUST_NM,
S.MED_IND,
S.MAC_IND,
S.HPP_IND,
S.STREET,
S.CITY,
S.STATE,
S.ZIP,
S.EUC,
S.STATUS,
S.AGR_TYP,
S.PRICE_SCHED,
S.OL_IND,
S.TRANS_IND,
S.CIRCUIT,
S.SUBSTATION,
S.OP_CENTER,
OUTAGE_STATUS_T(O.OUT_ID,
O.OUT_STATUS,
O.PO_DEV,
O.DEV_TYP,
O.CREW,
O.ETOR_TS,
O.TRBL_CD,
O.FIRST_RPT_TS,
O.END_TS,
O.CUST_CNT,
O.O_CALL_CNT,
OUTAGE_REPEAT_CALL_T(ORC.INITCALL_TS,
ORC.LASTCALL_TS,
ORC.CALL_SRC,
ORC.REP_ID,
ORC.CALL_CNT),
LIGHT_REPEAT_CALL_T(LRC.INITCALL_TS,
LRC.LASTCALL_TS,
LRC.CALL_SRC,
LRC.REP_ID,
LRC.CALL_CNT)
) AS OUTCUST
FROM
OMS.SITE S,
OMS.OUTAGE O,
OMS.OUTAGE_REPEAT_CALL ORC,
OMS.LIGHT_REPEAT_CALL LRC,
OMS.OUTAGE_TRANSFORMER OT
WHERE
S.ACCT = ' || pi_acctNum || ' AND
S.TRNFRMR_ID = OT.TRNFRMR_ID(+) AND
OT.OUT_ID = O.OUT_ID(+) AND
S.ACCT = ORC.ACCT(+) AND
S.ACCT = LRC.ACCT(+)';
I know this may sound confusing...but I apprecitate anyone's/everyone's suggestions!
MJB
DUKEPOWER CO.yes... here's the function that I also used as the expression...
FUNCTION uf_minutesDiff(pi_beginDte IN VARCHAR2, pi_endDte IN VARCHAR2) RETURN NUMBER
|| FUNC name: uf_minutesDiff
|| purpose: this function accepts A BEGINNING DATE AND ENDING DATE AND
|| RETURNS THE DIFFERENCE IN MINUTES
||
|| date: 12/19/2001
|| author: Mark J Brooks
||
|| history:
||
||
IS
iMinutes NUMBER;
/* LINE 280 */
BEGIN
select (to_date(pi_endDte,'DD-MON-YYYY:HH24:MI') -
to_date(pi_beginDte,'DD-MON-YYYY:HH24:MI'))*24*60
INTO iMinutes from dual;
IF iMinutes = 0
THEN
iMinutes := 1;
END IF;
RETURN iMinutes;
END uf_minutesDiff;
I also just used:
SQL> SELECT OUTAGE_REPEAT_CALL_T2( ORPC.INITCALL_TS,
2 ORPC.LASTCALL_TS,
3 ORPC.CALL_SRC,
4 (ORPC.LASTCALL_TS - SYSDATE) AS ELAPSED_TIME,
5 ORPC.REP_ID,
6 ORPC.CALL_CNT)
7 FROM
8 OMS.OUTAGE_REPEAT_CALL ORPC
9 WHERE
10 ORPC.ACCT=123456;
(ORPC.LASTCALL_TS - SYSDATE) AS ELAPSED_TIME,
ERROR at line 4:
ORA-00907: missing right parenthesis
with and without the parens
tx -
Use TYPE RECORD or Create Object TYPE to build Collection?
Hi All,
I need to pull in data from our ERP system via a DB Link to keep some of our Web Data up to date. I wasn't sure if I should pull the data into my collection by creating a TYPE RECORD or Creating an Object Type and fillng it that way. Is there a preferrable method?
Record:
TYPE ItemInventory IS RECORD (
ProductID Products.ProductID%TYPE,
Qty Products.QTY%TYPE);
Object:
Create Type ProdObj as Object(
ProductID Products.ProductID%TYPE,
QTY Products.QTY%TYPE);
Maybe both are suitable....wasn't sure.
Any suggestions/info is greatly apprecaited.
S
Edited by: ScarpacciOne on Feb 21, 2010 7:54 PMScarpacciOne wrote:
We have a complex view we use from our ERP system that allows us to pull all of our available inventory and update our website with that information. What I was thinking I would do is refactor the current procedures that are in place to update this information and pull that views information into a collection so that I could speed up the update process.The basic difference between the two is that one is a dumb record structure (similar to a C struct), whereas the other is an intelligent class (similar to a class definition in Java/C++). It can have methods and constructors.
The next major difference is that one can only be use in the PL language and not in SQL. The record struct is a PL data type definition. PL cannot provide SQL engine support for it.
On the other hand, the SQL type definition is supported by both the PL and SQL languages. This allows the type to be transparently used in both languages.
I usually prefer the SQL type definition approach in general, as it allows for more flexibility.
However, for pure collection processing in PL/SQL, there's very little to choose between the two approaches as they serve the exact same purpose - increasing performance by decreasing context switching between the PL and SQL engines.
So you need to look beyond mere bulk collection and bulk processing to decide on which approach to use. For example, a SQL type definition allows for a standard SQL projection from cursors, enabling PL/SQL code to be cursor agnostic (as each cursor, irrespective of the table(s) queried, returns the same object type). However, if the aim is simply to bulk collect from that specific cursor, then it is a lot simpler to use a PL record struct. -
We would like to have our customers/analysts to be able to create their own TOPLink query expression. I see the workbench has a SQL feature. However, does the TOPLink product have any GUI expression builder tool, for TOPLink query expression (not SQL)?
But no TOPLink query expression building in GUI instead of straight SQL or EJBQL.
I'm talking about "drag and drop" type of GUI features, allowing users to pick and choose the defined toplink persistent object/attributes to form the TOPLink query expression. -
Expression Builder: convert string to number
Hi all,
I'm having trouble building a field validation rule for bank account numbers.
The numbers have 12 positions, so I cannot use a string or text number.
The validation rule to be implemented is that the last two digits are calculated based on the first 10 (modulo 97).
However, when I use the Mid function to pick the first characters, I am unable to do any calculations on it. Apparently, the string to number conversion doesn't work (it should work when I read the manual, as it says that when using an operator between two data types, the second type is converted to the first (cf. example of 1234+abcd (should result in 1234 as to the manual))). So I tried '1*Mid(...)' or '0+Mid(...)'. Syntactically the expression builder accepts it and I can save it. BUT when I change the particular value on the screen, it gives me an SSO error (not the Field Validation error message I entered).
Why isn't there simply a function ToNumber (like ToChar)????? How could I workaround this?
Any input very welcome!
FrederikApparently, I was a bit confused when typing the first sentence, it should be:
The numbers have 12 positions, so I cannot use an integer or number data type, but have to use String. -
Using Multiple Object Types in a FIM Managed Criteria Distribution Group
Is it possible to use multiple object types in a criteria based distribution group. So when building your criteria filter, "Select (object type) that match (all/any) of the following condiftions". Currently you can only choose 1 object type and
I want to be able to choose object type "user" and a custom object type I create for my contactsYou can create main condition as "any" and later add two sub-conditions - one that object in set "All People" and other sub-condition that object in set "All Contacts" or "All Groups".
If you found my post helpful, please give it a Helpful vote. If it answered your question, remember to mark it as an Answer. -
Calling a PL/SQL from VB with IN argument of object type
I need to call a PL/SQL function in Oracle 8.1.6 from VB. One of the IN arguments is an object type (TYPE). How would I instantiate the variable of Oracle object type on VB side so that it can be passed to the Oracle?
Thank youYou have some flaws in your code.
First - don't use same identifier for pl sql variables ( including parameters) and column names. In your case oracle will evaluate the where clause as where column_name=column_name which is probably not what you want. The next one - you should ensure that select into yields one row , not more, not less, otherwise you 'll run into exception.
To actually print the desired values, you have to use dbms_output aware client ( sqlplus is such one) and for sqlplus in particular you have to issue set serveroutput on
Here is a very basic example how can you get it to work:
SQL> SELECT * FROM V$VERSION;
BANNER
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Product
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for Linux: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
SQL> CREATE OR REPLACE PROCEDURE FIND_EMPLOYEES
2 (p_first_name IN VARCHAR2)
3 IS
4 LAST varchar2(10);
5 BEGIN
6 SELECT LAST_NAME INTO LAST FROM EMPLOYEES WHERE FIRST_NAME = p_first_name;
7 dbms_output.put_line(LAST);
8 EXCEPTION
9 WHEN no_data_found THEN
10 dbms_output.put_line('There is no one employee with such first name!');
11 WHEN too_many_rows THEN
12 dbms_output.put_line('There are many employees with such first name, try with another one!');
13 END FIND_EMPLOYEES;
14 /
Procedure created.
SQL> SET SERVEROUTPUT ON
SQL> EXEC FIND_EMPLOYEES('Julia')
There are many employees with such first name, try with another one!
PL/SQL procedure successfully completed.
SQL> EXEC FIND_EMPLOYEES('Eugenia')
There is no one employee with such first name!
PL/SQL procedure successfully completed.
SQL> EXEC FIND_EMPLOYEES('Adam')
Fripp
PL/SQL procedure successfully completed.Best regards
Maxim -
Logical SQL about Expression Builder
Dear all
I am Michel.
When I was always trouble,
everyone will go to support this Forum, I am glad.
I want to fix Logical SQL about Expression Builder of Oracle BI 11.1.1.3.
In detail, Business each year, fiscal year you want to make is to display
the beginning of the fiscal year of April 1, always, the data,
"OUTPUT_DATE" from April until March the following year.
Currently being output error is as follows.
:[nQSError: 22020] Function Subtring ( argument 1) does not support non-text types. (HY000)
I want to fix logical SQL is as follows.
case when substring("app_support"."TABLE_NAME"."OUTPUT_DATE" from 4 for 5)
in ('04','05','06','07','08','09','10','11','12')
then Cast
Concat
Substring(
Cast(
"app_support"."TABLE_NAME"."OUTPUT_DATE" AS char
FROM 4 for 8
'04-01'
AS DATE
when substring("app_support"."TABLE_NAME"."OUTPUT_DATE" from 4 for 5)
in ('01','02','03')
then timestampadd(SQL_TSI_YEAR,-1,
Cast
Concat
Substring(
Cast(
"app_support"."TABLE_NAME"."OUTPUT_DATE" AS char
FROM 4 for 8
'04-01'
AS DATE
For reference, logical SQL follows,
there is no error, and it is operating normally.
Cast
Concat(
Substring(
Cast(
"app_support"."TABLE_NAME"."OUTPUT_DATE" AS char
FROM 0 for 5
'-01')
AS DATE
I will grad to reply message.
Thanks and regards.Dear Fame and all
Hello.Thanks you for reply.
Hi,
You Missed END key word in the statement.Sorry,I mistake copy & paste only.
So,The problem is still not resolved.
The following shows, that the error has been corrected in the first message.
Dear all
I am Michel.
When I was always trouble,
everyone will go to support this Forum, I am glad.
I want to fix Logical SQL about Expression Builder of Oracle BI 11.1.1.3.
In detail, Business each year, fiscal year you want to make is to display
the beginning of the fiscal year of April 1, always, the data,
"OUTPUT_DATE" from April until March the following year.
Currently being output error is as follows.
:[nQSError: 22020] Function Subtring ( argument 1) does not support non-text types. (HY000)
I want to fix logical SQL is as follows.
case when substring("app_support"."TABLE_NAME"."OUTPUT_DATE" from 4 for 5)
in ('04','05','06','07','08','09','10','11','12')
then Cast
Concat
Substring(
Cast(
"app_support"."TABLE_NAME"."OUTPUT_DATE" AS char
FROM 4 for 8
'04-01'
AS DATE
when substring("app_support"."TABLE_NAME"."OUTPUT_DATE" from 4 for 5)
in ('01','02','03')
then timestampadd(SQL_TSI_YEAR,-1,
Cast
Concat
Substring(
Cast(
"app_support"."TABLE_NAME"."OUTPUT_DATE" AS char
FROM 4 for 8
'04-01'
AS DATE
end
For reference, logical SQL follows,
there is no error, and it is operating normally.
Cast
Concat(
Substring(
Cast(
"app_support"."TABLE_NAME"."OUTPUT_DATE" AS char
FROM 0 for 5
'-01')
AS DATE
I will grad to reply message.
Thanks and regards. -
How To Declare an Exception As a Field Inside an Object Type
Hi All;
How can i declare(define as a property) an exception in a object type?
Best Regards...
Connected to Oracle Database 10g Enterprise Edition Release 10.2.0.1.0
Connected as hr
SQL>
SQL> CREATE TYPE ex_t AS OBJECT
2 (
3 i NUMBER,
4 e EXCEPTION,
5 MEMBER FUNCTION get_i RETURN number
6 )
7 ;
8 /
Warning: Type created with compilation errors
SQL> show err
Errors for TYPE HR.EX_T:
LINE/COL ERROR
PLS-00103: Encountered the symbol "EXCEPTION" when expecting one of the following:
<an identifier> <a double-quoted delimited-identifier> LONG_ double ref char time timestamp interval date binary national
character nchar The symbol "<an identifier> was inserted before "EXCEPTION" to continue.
SQL>> 2- You could create a different class just to handle exceptions and call it from this one (again you would build a varchar2 attribute to pass the message).
Like this one perhaps. (I've not looked at it in a couple of years though.)
EXCEPTION is not a SQL datatype. Valid datatypes are listed here. -
Problem with decimal data visualization in a circular graphic object type
When we are design a report using Crystal Reports 2008 we found the following problem. When we insert an object of type circle graphic selecting the option in the graphics wizard for view in the legend data both in value and percentage (u2018bothu2019 design) we cant show them in a two decimals format at the same time.
Using the option u2018number formatu2019 and indicating two decimals only affects the value but not the percentage.
Show both the value and the percentage with two decimals at same time itu2019s a necessary requirement for our report design.
Is there any way to show both the value and the percentage in a circle graphic object with two decimals at the same time?
Thanks.hello Jose,
i am not sure what you mean by "circular graphic object type".
there's nothing in the standard cr 2008 build that has this that i've ever found that creates a circle other than inserting a box and changing the rounding on the corners. if you're using a 3rd party product or add-on you'll need to contact whoever built it.
cheers,
jamie -
Dynamically built query on execution How to save the data in Object Type
Hi,
In pl/sql I am building and executing a query dynamically. How can I stored the output of the query in object type. I have defined the following object type and need to store the
output of the query in it. Here is the Object Type I have
CREATE OR REPLACE TYPE DEMO.FIRST_RECORDTYPE AS OBJECT(
pkid NUMBER,
pkname VARCHAR2(100);
pkcity VARCHAR2(100);
pkcounty VARCHAR2(100)
CREATE OR REPLACE TYPE DEMO.FIRST_RECORDTYPETAB AS TABLE OF FIRST_RECORDTYPE;Here is the query generated at runtime and is inside a LOOP
--I initialize my Object Type*
data := new FIRST_RECORDTYPETAB();
FOR some_cursor IN c_get_ids (username)
LOOP
x_context_count := x_context_count + 1;
-- here I build the query dynamically and the same query generated is
sql_query := 'SELECT pkid as pid ,pkname as pname,pkcity as pcity, pkcounty as pcounty FROM cities WHERE passed = <this value changes on every iteration of the cursor>'
-- and now I need to execute the above query but need to store the output
EXECUTE IMMEDIATE sql_query
INTO *<I need to save the out put in the Type I defined>*
END LOOP;
How can I save the output of the dynamically built query in the Object Type. As I am looping so the type can have several records.
Any help is appreciated.
Thankshai ,
solution for Dynamically built query on execution How to save the data in Object Type.
Step 1:(Object creation)
SQL> ED
Wrote file afiedt.buf
1 Create Or Replace Type contract_details As Object(
2 contract_number Varchar2(15),
3 contrcat_branch Varchar2(15)
4* );
SQL> /
Type created.
Step 2:(table creation with object)
SQL> Create Table contract_dtls(Id Number,contract contract_details)
2 /
Table created.
Step 3:(execution Of procedure to insert the dynamic ouput into object types):
Declare
LV_V_SQL_QUERY Varchar2(4000);
LV_N_CURSOR Integer;
LV_N_EXECUTE_CURSOR Integer;
LV_V_CONTRACT_BR Varchar2(15) := 'TNW'; -- change the branch name by making this as input parameter for a procedure or function
OV_V_CONTRACT_NUMBER Varchar2(15);
LV_V_CONTRACT_BRANCH Varchar2(15);
Begin
LV_V_SQL_QUERY := 'SELECT CONTRACT_NUMBER,CONTRACT_BRANCH FROM CC_CONTRACT_MASTER WHERE CONTRACT_BRANCH = '''||LV_V_CONTRACT_BR||'''';
LV_N_CURSOR := Dbms_Sql.open_Cursor;
Dbms_Sql.parse(LV_N_CURSOR,LV_V_SQL_QUERY,2);
Dbms_Sql.define_Column(LV_N_CURSOR,1,OV_V_CONTRACT_NUMBER,15);
Dbms_Sql.define_Column(LV_N_CURSOR,2,LV_V_CONTRACT_BRANCH,15);
LV_N_EXECUTE_CURSOR := Dbms_Sql.Execute(LV_N_CURSOR);
Loop
Exit When Dbms_Sql.fetch_Rows (LV_N_CURSOR)= 0;
Dbms_Sql.column_Value(LV_N_CURSOR,1,OV_V_CONTRACT_NUMBER);
Dbms_Sql.column_Value(LV_N_CURSOR,2,LV_V_CONTRACT_BRANCH);
Dbms_Output.put_Line('CONTRACT_BRANCH--'||LV_V_CONTRACT_BRANCH);
Dbms_Output.put_Line('CONTRACT_NUMBER--'||OV_V_CONTRACT_NUMBER);
INSERT INTO contract_dtls VALUES(1,CONTRACT_DETAILS(OV_V_CONTRACT_NUMBER,LV_V_CONTRACT_BRANCH));
End Loop;
Dbms_Sql.close_Cursor (LV_N_CURSOR);
COMMIT;
Exception
When Others Then
Dbms_Output.put_Line('SQLERRM--'||Sqlerrm);
Dbms_Output.put_Line('SQLERRM--'||Sqlcode);
End;
step 4:check the values are inseted in the object included table
SELECT * FROM contract_dtls;
Regards
C.karukkuvel -
Problem Instanciating BO - No default attribute defined for the object type
Hello Experts,
I am instanciating the BO BUS2038 to ZBUS2038 and when I click in u201Cto implementedu201D and follow u201Cto releasedu201D the message No default attribute defined for the object type is appearing!
Can anybody help, please?Hello everyone,
it appears to me, that no one has a clue about the "default attribute" and is widely guessing what can be done about that.
I feel deeply sorry for that, Marcos.
At first: You don't really need to care about the missing default attribute. If it's missing, the object's instance key will be used instead. Skip the warning message.
Secondly: The default attribute is used to display the instance within the "Object links & Attachments" under the work item preview when using the SAP Business Workflow.
Thirdly: You can select any existing attribute of your business object type to be the default attribute, by navigating to the "Basic data" (it's the heat-icon within the object builder), use tab "Defaults" and use the Input Help on the field "Attribute".
There you'll go.
Best wishes,
Florin -
Invoking stored procedure that returns array(oracle object type) as output
Hi,
We have stored procedures which returns arrays(oracle type) as an output, can anyone shed some light on how to map those arrays using JPA annotations? I tried using jdbcTypeName but i was getting wrong type or argument error, your help is very much appreciated. Below is the code snippet.
JPA Class:
import java.io.Serializable;
import java.sql.Array;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.Id;
import org.eclipse.persistence.annotations.Direction;
import org.eclipse.persistence.annotations.NamedStoredProcedureQuery;
import org.eclipse.persistence.annotations.StoredProcedureParameter;
* The persistent class for the MessagePublish database table.
@Entity
@NamedStoredProcedureQuery(name="GetTeamMembersDetails",
procedureName="team_emp_maintenance_pkg.get_user_team_roles",
resultClass=TeamMembersDetails.class,
returnsResultSet=true,
parameters={
@StoredProcedureParameter(queryParameter="userId",name="I_USER_ID",direction=Direction.IN,type=Long.class),
@StoredProcedureParameter(queryParameter="employeeId",name="I_EMPLOYEEID",direction=Direction.IN,type=Long.class),
@StoredProcedureParameter(queryParameter="TEAMMEMBERSDETAILSOT",name="O_TEAM_ROLES",direction=Direction.OUT,jdbcTypeName="OBJ_TEAM_ROLES"),
@StoredProcedureParameter(queryParameter="debugMode",name="I_DEBUGMODE",direction=Direction.IN,type=Long.class)
public class TeamMembersDetails implements Serializable {
private static final long serialVersionUID = 1L;
@Id
private long userId;
private List<TeamMembersDetailsOT> teamMembersDetailsOT;
public void setTeamMembersDetailsOT(List<TeamMembersDetailsOT> teamMembersDetailsOT) {
this.teamMembersDetailsOT = teamMembersDetailsOT;
public List<TeamMembersDetailsOT> getTeamMembersDetailsOT() {
return teamMembersDetailsOT;
Procedure
PROCEDURE get_user_team_roles (
i_user_id IN ue_user.user_id%TYPE
, o_team_roles OUT OBJ_TEAM_ROLES_ARRAY
, i_debugmode IN NUMBER :=0)
AS
OBJ_TEAM_ROLES_ARRAY contains create or replace TYPE OBJ_TEAM_ROLES_ARRAY AS TABLE OF OBJ_TEAM_ROLES;
TeamMembersDetailsOT contains the same attributes defined in the OBJ_TEAM_ROLES.A few things.
You are not using a JDBC Array type in your procedure, you are using a PLSQL TABLE type. An Array type would be a VARRAY in Oracle. EclipseLink supports both VARRAY and TABLE types, but TABLE types are more complex as Oracle JDBC does not support them, they must be wrapped in a corresponding VARRAY type. I assume your OBJ_TEAM_ROLES is also not an OBJECT TYPE but a PLSQL RECORD type, this has the same issue.
Your procedure does not return a result set, so "returnsResultSet=true" should be "returnsResultSet=false".
In general I would recommend you change your stored procedure to just return a select from a table using an OUT CURSOR, that is the easiest way to return data from an Oracle stored procedure.
If you must use the PLSQL types, then you will need to create wrapper VARRAY and OBJECT TYPEs. In EclipseLink you must use a PLSQLStoredProcedureCall to access these using the code API, there is not annotation support. Or you could create your own wrapper stored procedure that converts the PLSQL types to OBJECT TYPEs, and call the wrapper stored procedure.
To map to Oracle VARRAY and OBJECT TYPEs the JDBC Array and Struct types are used, these are supported using EclipseLink ObjectRelationalDataTypeDescriptor and mappings. These must be defined through the code API, as there is currently no annotation support.
I could not find any good examples or doc on this, your best source of example is the EclipseLink test cases in SVN,
http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/trunk/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/plsql/
http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/trunk/foundation/eclipselink.core.test/src/org/eclipse/persistence/testing/tests/customsqlstoredprocedures/
James : http://www.eclipselink.org -
Working with oracle object type tables
Hi,
I've created a table which only contains Oracle object types (e.g. CREATE TABLE x OF <...>). When I create an Entity for this table using the Entity wizard, I end up with an entity with the attributes of the base object type and two special attributes REF$ (reference to the object type instance) and SYS_NC_OID$ (unique object identifier). The REF$ attribute is on the Java side of type oracle.jbo.domain.Ref and the other attribute is on the Java side a simple String.
It seems this only allows me to save objects of the base type in this table. First of all in my situation this is also impossible because the base type is not instantiable. What I do want is to save several different subtypes into this table using the BC4J custom domain mechanism. Is there any way to make this possible? I first thought I could maybe do something with the special REF$ attribute, but this doesn't seem te case. So I might need to override most of the EntityImpl methods, like doUML, remove etc. Am I right? And does anyone have any hints on how to do this?
Regards,
PeterPeter:
Hi,
I've created a table which only contains Oracle
object types (e.g. CREATE TABLE x OF <...>).
When I create an Entity for this table using the
Entity wizard, I end up with an entity with the
attributes of the base object type and two special
attributes REF$ (reference to the object type
instance) and SYS_NC_OID$ (unique object identifier).
The REF$ attribute is on the Java side of type
oracle.jbo.domain.Ref and the other attribute is on
the Java side a simple String.
It seems this only allows me to save objects of the
base type in this table. First of all in my situation
this is also impossible because the base type is not
instantiable. What I do want is to save several
different subtypes into this table using the BC4J
custom domain mechanism. Is there any way to make
this possible? Sorry, but this is not supported out of the box.
Since you have an object table, you wouldn't use domains to achieve this. Instead, you would have a superclass and subclass entity objects, e.g., PersonEO subclassed into StudentEO and EmployeeEO.
I first thought I could maybe do
something with the special REF$ attribute, but this
doesn't seem te case. So I might need to override
most of the EntityImpl methods, like doUML, remove
etc. Am I right? And does anyone have any hints on
how to do this?
If you want, you can try this by overridding EntityImpl's:
protected StringBuffer buildDMLStatement(int operation,
AttributeDefImpl[] allAttrs,
AttributeDefImpl[] retCols,
AttributeDefImpl[] retKeys,
boolean batchMode)
and
protected int bindDMLStatement(int operation,
PreparedStatement stmt,
AttributeDefImpl[] allAttrs,
AttributeDefImpl[] retCols,
AttributeDefImpl[] retKeys,
HashMap retrList,
boolean batchMode) throws SQLException
Handle the case when operation == DML_INSERT.
There, build an insert statement with substitutable row, e.g.:
INSERT INTO persons VALUES (person_t('Bob', 1234));
INSERT INTO persons VALUES (employee_t('Joe', 32456, 12, 100000));
where person_t and employee_t are database types and you are invoking the respective constructor.
Thanks.
Sung -
Why is ADF Bindings node not displayed in Expression Builder window?
Hello,
I'm using Oracle JDeveloper Studio Edition Version 11.1.1.1.0, and I've created a Fusion Web Application and I've configured ADF Authentication and Security for my web project, using the provided wizard.
On a certain page, I've placed a Go Link component, and I'm trying to edit the Text and Destination Property using EL Expressions. When I open the Expression Builder window all I can see are the following nodes: ADF Controller Objects, ADF Managed Beans, JSF Managed Beans and JSP Objects, but no ADF Bindings. I need to access the securityContext properties, and from what I've read in B31974-03, I need ADF Bindings.
Also, I've tryied using the search field from the Expression Builder windows, without any luck.
This is probably a newbie problem, but I really can't figure it out. Please help.
Bogdan.Hi,
maybe your problem is that you don't have created pageDef related with your page. Try right click on your page and Go To Page Definition. It will create the related pageDef if it does not exist.
Hope this helps
Joseba
Maybe you are looking for
-
Photoshop CC 2014, "Could not complete your request b/c program error"
I've not seen this since the early CS days, and generally found Photoshop CC to be extremely stable. However since starting to use CC 2014, I've had this happen six times - not in a row, just at random occasions doing completely unrelated things. Exa
-
Code Collapse/Folding in Flex Builder?
Hi, I am using Flex Builder. Is there a way to keep my code collapsed/folded? If I open up a file with a ".as" extension I can collapse my functions but they don't stay collapsed when I re-open the file. 1. Is there a way to keep the code folded so
-
Photoshop Elements 13 upgrade problem!?
I bought Photoshop Elements 13 upgrade version. Previous version PSE7 has been activated 3 years ago. My computer is connected to the internet via wifi with a speed of 100/10M. Every time I try to open my new program it tell´s to me, that Sign in Re
-
Retreiving the guid for target group selected for trade promotion in CRM 7
HI, I am working on building API for creating trade promotion. I need to find a way where I could retreive the GUID of the target group to be assigned to the trade promotion. Please share you thoughts on this. Let me know if we could use any standard
-
Using Add-SQLAvailabilityDatabase command
Hi All, I'm trying to get the Add-SqlAvailabilityDatabase command working. This is how the command is supposed to be formatted: Add-SqlAvailabilityDatabase -Path "SQLSERVER:\SQL\PrimaryServer\InstanceName\AvailabilityGroups\MyAg" -Database "MyDatabas