One class map to two existing tables

I have two existing tables, inventoryTbl and supplierTbl
inventoryTbl has following columns:
inventoryIdCol ( Primary Key )
inventoryTypeCol
inventoryAmountCol
supplierIdCol ( Foreign key to supplierTbl )
supplierTbl has following columns:
supplierIdCol ( Primary Key )
supplierNameCol
supplierAddressCol
I have on JDO Class called inventory which want to map to the above
two tables.
it has all these fields:
inventoryId;
inventoryType
inventoryAmount
supplierIdCol
supplierName
supplierAddress
How do I implement it?
Question 1:
Notice Kodo DTD has fk and join extension. Can I use them to implement?
If so, could you give us an example? there is no example in the Kodo
package.
Question 2:
Notice Kodo Developer guide mention the key-column and ref-column.
But by definition, they are only used for Collection/Map field type.
My case is neither of them. they can not be used in my case?
Question 3:
Any other way? Kodo developer guide mention the 'custom-mapping'
extension. How do I use it?
thanks,
John

Answer 1: There are no fk and join extensions. They are used in our
reversemapping process. Kodo 3.0 has more verbose extensions (if
you want to look at that (beta) version's documentation).
Answer 2: You won't need them to map your situation (see later)
Answer 3: I would suggest against this... it is not a trivial task nor
well documented and WILL change with our upcoming 3.0 release (which is
far easier to customize and documentation-wise).
All those things being said, short of trying out Kodo 3.0 which is in
(early) beta form, the easiest way is to map the supplierTbl to its own
class. Note that this class does not have to be exposed at the
application level. For example:
public class Inventory {
private Supplier supplier;
public String getSupplierName () {
return supplier.getSupplierName ();
public void setSupplierName (String name) {
supplier.setSupplierName (name);
One can do more funky stuff using javax.jdo.InstanceCallbacks (jdoPostLoad
() and jdoPreStore ()), however, I find the above strategy to be the
easiest as it doesn't require any JDO dependencies in your application
classes as well as requiring a lower level of undestanding of the
PersistenceCapable lifecycle.
On Thu, 14 Aug 2003 20:19:54 +0000, w wrote:
>
I have two existing tables, inventoryTbl and supplierTbl
inventoryTbl has following columns:
inventoryIdCol ( Primary Key )
inventoryTypeCol
inventoryAmountCol
supplierIdCol ( Foreign key to supplierTbl )
supplierTbl has following columns:
supplierIdCol ( Primary Key )
supplierNameCol
supplierAddressCol
I have on JDO Class called inventory which want to map to the above
two tables.
it has all these fields:
inventoryId;
inventoryType
inventoryAmount
supplierIdCol
supplierName
supplierAddress
How do I implement it?
Question 1:
Notice Kodo DTD has fk and join extension. Can I use them to implement?
If so, could you give us an example? there is no example in the Kodo
package.
Question 2:
Notice Kodo Developer guide mention the key-column and ref-column.
But by definition, they are only used for Collection/Map field type.
My case is neither of them. they can not be used in my case?
Question 3:
Any other way? Kodo developer guide mention the 'custom-mapping'
extension. How do I use it?
thanks,
John--
Steve Kim
[email protected]
SolarMetric Inc.
http://www.solarmetric.com

Similar Messages

  • Error while running code template mapping between two oracle tables

    Hello All
    Iam getting the following error while running code template mapping between two oracle tables. Using OWB 11gR2 and oracle 11gR2 DB.
    java.sql.SQLException: ORA-20001: The active workspace is not valid as a target for this mapping
    c: at "OWBSYS.WB_RT_MAPAUDIT_UTIL", line 1065
    ORA-06512: at "OWBSYS.WB_RT_MAPAUDIT_UTIL", line 1087
    ORA-06512: at "SOURCE.FILENET_EX_UNIT_3", line 555
    ORA-06512: at line 4                                        
    Job 51 error: java.sql.SQLException: ORA-20001: The active workspace is not valid as a target for this mapping
    ORA-06512: at "OWBSYS.WB_RT_MAPAUDIT_UTIL", line 1065
    ORA-06512: at "OWBSYS.WB_RT_MAPAUDIT_UTIL", line 1087
    ORA-06512: at "SOURCE.FILENET_EX_UNIT_3", line 555
    ORA-06512: at line 4
    Quick help is highly appreciated.

    Dera Dallan
    its only a target user for the workspace where you are deploying the mapping from.
    I have two repositories for two different projects. each repositary has its own workspace.
    ex:-
    Project 1
    Work space bpms_rep_owner
    Repositary owner bpms_rep_owner
    Repositary user bpms_rep_user
    Project 2
    Work space dem_rep_owner
    Repositary owner dem_rep_owner
    Repositary user dem_rep_user
    Reg
    S.Gyazuddin

  • Create a relationship between two existing tables

    When I create a new table the wizard exposes the ability to add a foreign key column. However when editing an existing table the only option I seem to have is to create a lookup table, which is a new table that is autogenerated. I find it hard to believe that it's impossible to create and manage relationships in APEX...but I've unable to find the access point if there is one.

    Hello,
    I'm not sure what version of APEX you are using as you don't say, but in my 2.2.0.00.32 installation, when I select a table using the Object Browser, select Constraints from the choices running along the top of the page, then click the Create button/link, the Foreign Key option is available in the Constraint Type drop-down list.
    Hope that helps a bit,
    Mark

  • How to map betwwen two custom table

    Hi,
    I have two custom table like GL1000 & GL1001 in HR(Should be same behavior HRP1000 & HRP10001). I need to pass the data webdynpro screen through BADI. The Method would be Create, FIND, READ, DELIMT, and UPADTE when i create BADI definition.
    My Question How to map both custom table GL1000 & GL1001, How to create, how to read, how to update, How to maintain relationship.
    Thx!
    Achin

    Hi,
    Firstly you cannot create a custom table with the name GL1000 & GL1001... it has to start with y or z...
    for example... ZGL1000 & ZGL1001... and you can create these table from SE11 and you can give the relationship whicle creating the table in SE11 itself... and to read or update the table either from SE16 or you can write code in your webdyn program to read and update the table...
    Regards,
    Siddarth

  • How to Store the result sets of a stored procedure that is returning more that one result set in two different table ?

    Hi Experts,
       I have on stored procedure which returns mote than one resultset i want that to store in two different temp table how can achieve this in SQL server.
     following is the stored procedure and table that i need to create.
    create procedure GetData as begin select * from Empselect * from Deptend 
    create table #tmp1 (Ddeptid int, deptname varchar(500),Location varchar(100))
    Insert into #tmp1 (Ddeptid , deptname ,Location )
    exec GetData
    create table #tmp (empid int , ename varchar(500),DeptId int , salary int)
    Insert into #tmp (empId,ename,deptId,salary)
    exec GetData
    Niraj Sevalkar

    You cant get two resultsets out of SP like this. The workaround is to merge and bring the resultsets.
    For this number of columns as well as corresponding datatypes have to be compatible. Also you will need one additional column which indicates resultset value. Then use this as filter to get your desired resultset out
    create procedure GetData as
    begin
    select 'resultset1' as Cat,*,.. N columns from Emp
    union all
    select 'resultset2' as Cat,*,.. N columns from Dept
    end
    create table #tmp1 (Ddeptid int, deptname varchar(500),Location varchar(100))
    Insert into #tmp1 (Ddeptid , deptname ,Location )
    Select column1,column2,column3
    from OPENROWSET('SQLOLEDB','Data Source=Server_name;Trusted_Connection=yes;
    Integrated Security=SSPI','Execute yourdb..GetData')
    WHERE Cat = 'resultset1'
    create table #tmp (empid int , ename varchar(500),DeptId int , salary int)
    Insert into #tmp (empId,ename,deptId,salary)
    Select column1,column2,column3, column4
    from OPENROWSET('SQLOLEDB','Data Source=Server_name;Trusted_Connection=yes;
    Integrated Security=SSPI','Execute yourdb..GetData')
    WHERE Cat = 'resultset2'
    also see
    http://sqlblogcasts.com/blogs/madhivanan/archive/2007/11/26/select-columns-from-exec-procedure-name-is-this-possible.aspx
    Another method is to populate table with relevant resultset within procedure itself and then select from the table directly outside.
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Match-any or Match All For Class-map On Nexus?

      I have an access-list MANAGEMENT
            permit udp any eq snmp any
            permit udp any any eq snmp
            permit tcp any any eq telnet
            permit tcp any eq telnet any
           permit tcp any any eq 22
           permit tcp any eq 22 any
    My question does it matter if I use a match-any or match-all. I want to match anything in the access-list to classify the traffic correctly
     class-map type qos match-any MANAGEMENT
                match access-group name MANAGEMENT
    Or
    class-map type qos match-all MANAGEMENT
                match access-group name MANAGEMENT
    I understand a match-any is an or and a match-all is an and function. Does this apply to an access-list for  a class-map?
    Thanks

    It applies to match statements within the class map. In your case, you're only using one match statement, so there will be no difference between match-all and match-any, no matter how many entries are in the ACL. If your class map had two different ACLs in two different match statements , then the and/or logic of match-all and match-any would come into play.

  • Existing table metadata extensions ignored

    I have tried to use kodo metadata extensions to map objects to existing
    tables.
    I used extensions from the Kodo documentation example.
    First I run schema tool with refresh option and complete schema was
    generated (tables with X at the end), as all extension instructions were
    ignored.
    After that I run schema tool with register option. This time an exception
    was thrown showing a SQL statement looking for tables with X at the end.
    Again it looks as extension instructions from jdo file were ignored.
    Could someone define required steps when using an existing schema and what
    should be done so Kodo starts using metadata extensions?
    Thanks.

    There are no special steps to starting to use metadata extensions. Is it
    possible that you have another set of metadata without extensions lying around,
    and Kodo is picking that one up?
    Or perhaps you could post your metadata, so we can see if there are any
    errors in it.

  • ACE: a class-map with multiple ports... what about the probe/serverfarm?

    Hello Gilles,
    One question about something I was not able to find in the documentation.
    Lets say I have one class-map which includes 2 ports (in this case https and 5061).
    Can I associate this class-map to just 1 generic serverfarm and probe for both ports or I have to specify 2 serverfarms/rservers/probes?
    So, by not specifying the ports on the rserver, if a request is received on port 443 (or 5061), it is sent to the same respective port on the rserver?
    The same way is valid for the generic probe.  ACE module is able to probe both ports based on the class-map?
    Thanks and have a great day!!
    Giulio.
    probe tcp PROBE_GENERIC_TCP
      description This probe works for all TCP services by inheriting the VIP port.
      interval 15
      faildetect 2
      passdetect interval 15
      passdetect count 2
      open 2
    rserver host SERVER1_ACCESS
      ip address <1AC>
      inservice
    rserver host SERVER2_ACCESS
      ip address <2AC>
      inservice
    serverfarm host ACCESS-SFARM
      probe PROBE_GENERIC_TCP
      rserver SERVER1_ACCESS
        inservice
      rserver SERVER2_ACCESS
        inservice
    class-map match-any OCS_L4ACCESS
      2 match virtual-address x.x.x.176 tcp eq https
      2 match virtual-address x.x.x.176 tcp eq 5061
    policy-map type loadbalance first-match OCS_L4ACCESS
      class class-default
        sticky-serverfarm ACCESS_STICKY
    policy-map multi-match POLICY
    class OCS_L4ACCESS
    loadbalance vip inservice
    loadbalance policy OCS_L4ACCESS
    loadbalance vip icmp-reply active
    connection advanced-options OCS_VIPTIMEOUT
    nat dynamic XXX vlan 503

    Even if you use the 4710 appliance or expect the inheritance in the module software, it's worth considering if this is really what you want. If you keep multiple ports in the L3/L4 class-map you can't handle the services independently. You will have a common serverfarm for both https and 5061. If https service stops on one rserver, the ACE will place that rserver (and not that service) in out-of-operation state and it won't receive any 5061 traffic either. (You have the fail-on-all probe option but I wouldn't say it's a better choice. In that case, https traffic would be sent to the rserver even if https port is closed as long as there is at least one working service on it.) That's why I prefer a separate class-map and separate serverfarm for each service. (They can contain the same rservers, no need to duplicate.) BUT if the software supports probe port inheritance, you can benefit from it even in this scenario: serverfarm-443 and serverfarm-5061 can both use your PROBE_GENERIC_TCP.

  • I'd like to do this mapping: one class=one tables !!!

    Hello,
    I am a new user of kodo, in my application all classes extend my
    YOBaseObject class, so when I generate the schema of my msql database
    using the mappingTool (as: mappingTool -a refresh package.jdo) only the
    table yobaseobject is created.
    My gaol is the get one table for a class.
    thank you,
    smail

    Smail-
    By default, Kodo uses the "flat" class mapping, which stores all of the
    subclasses in the table of the top-level persistent class.
    You may want to use "vertical" (one table per class in the hierarchy) or
    "horizontal" (one table per concrete subclass, no table for abstract
    superclass). Take a look at the documentation for the different class
    mappings at:
    http://docs.solarmetric.com/manual.html#ref_guide_mapping_classmapping
    Let us know if you have any questions about any of this.
    In article <cc0gr4$iv7$[email protected]>, ouhmmou wrote:
    Hello,
    I am a new user of kodo, in my application all classes extend my
    YOBaseObject class, so when I generate the schema of my msql database
    using the mappingTool (as: mappingTool -a refresh package.jdo) only the
    table yobaseobject is created.
    My gaol is the get one table for a class.
    thank you,
    smail
    Marc Prud'hommeaux
    SolarMetric Inc.

  • Mapping one-many cmp relation without association table

    Hello:
    I want to know if I can map a relationship with this model:
    Table department
    -deptPK (PK)
    -deptNo (constraint unique)
    -deptoDescription
    Table employee
    -empPK (PK)
    -empName
    -deptNo (FK)
    My problem is that i can't establish the relation employee-department because the FK in employee is not the PK of department.
    Thanks
    Miguel

    The first thought that comes to mind is a problem with your primary key for class B. If two instances have the same primary key (or at least what you told TopLink constitutes the primary key) you may lose one of the objects or perhaps have the same object in the list twice.
    --Shaun                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Unable to join two fact tables via one common dimension in RPD(Repository)

    I have created two fact tables F1 & F2 and one dimension D.
    F1 is joined to D and F2 is also joined to D in Physical layer as well as in BMM layer.
    I created one report in OBI Answers using these three tables.It Showed me the following error.
    **Error Details**
    **Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P**
    **State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 15018] Incorrectly defined logical table source (for fact table dfghdfh) does not contain mapping for [Dashboard_Fact.Period_Sgt_Key]. (HY000)**
    **SQL Issued: SELECT dfghdfh.Period_Sgt_Key saw_0, "Period Dim".Period_Sgt_Key saw_1, Dashboard_Fact.Period_Sgt_Key saw_2 FROM service_delivery ORDER BY saw_0, saw_1, saw_2**
    How to cope up with the issue or can anyone tell me the alternate workaround for this?

    That is what i have tried.
    I have made a logical table TEST and dragged two fact tables f1 & f2 in source.
    Now when i drag different columns from different fact tables(that are in TEST logical table) in report, it gives an error and not making any joins that you are mentioning.
    ERROR MESSAGE:--
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 15018] Incorrectly defined logical table source (for fact table Test) does not contain mapping for [Test.SurveyName_Id, Test.SurveyHead_Id, Test.Respondent_Id, Test.SDBusiness_Area_Id, Test.Period_Sgt_Key, Test.OBS_Id, Test.VOCBusiness_Area_Id, Test.Question_Sgt_Key]. (HY000)
    The columns mentioned in the error message are all from test logical table..some are from F1 & some from F2.

  • Two fact tables in one business area

    Hi,
    Would there be problem if two fact tables, one flat, one with hierarchy, in one business area. Both fact tables are joined to same set of dimension tables except one: region_1 to fact_1, region_2 to fact_2. The consistency check is fine. But I get error in Answers. I don't have the exact error with me, but it is complains about fact_1 is not linked region_2.
    Any suggestions ?
    Thanks.

    Thank you, Stijn, Ced for your kind reply.
    I did not explain it clearly.
    The fact_1 (flat) table has data in all levels (detailed and aggregated). For example, it has % sales to planned from city, state to national (we were not provided with numberator and demoninator to aggregate the detailed data). The fact_2 table has only city level data and have a dimension region_2 with city, state and national hierarchy. For data in Fact_1 table, we simply want to show them in reports. For data in Fact_2 table, reports can drill-down.
    In Answers, the error is "Incorrectly defined logical table source ( for fact table Fact_1) does not contain mapping for region_2.state_id".

  • How to add one more field to an exist internal table

    hi abapers
    i am a very new abap programmer and just started learning it.
    i want to know How to add one more field to an exist internal table.
    lemme me put my question in a very simple way.
    i have a internal table having fields f1,f2,f3 and which also that internal also contains some data.
    now i want to add two more fields (mm & nn) to that internal table now.
    how can i do that.
    and i wanna know the websites names where i can find some brain teasing questions in abap programming.
    eagerly waiting for ur reply
    regards,
    Maqsood A Khan

    Hi, MAQSOOD.
    You can insert more fields in your internal table like this.
    refer this code snippet.
    DATA : BEGIN OF tbl_itab OCCURS 0.
            INCLUDE STRUCTURE zsdtc009.
    DATA :  vkorg   LIKE vbak-vkorg,  "inserted one
            vtweg   LIKE vbak-vtweg,  "inserted one
            vkbur   LIKE vbak-vkbur,  "inserted one
            vkgrp   LIKE vbak-vkgrp,  "inserted one
           END OF tbl_itab.
    you can also read the book "Teach yourself abap in 21 days"
    at http://cma.zdnet.com/book/abap/
    but that book is just about basic concept of abap and report program.
    it doesn't give a lecture for on-line program.
    you can get pdf version books(about abap, sap...things) from sap.
    http://help.sap.com/printdocu/core/Print46c/en/Data/htm/english.htm
    I wish I could help you.
    Regards
    Kyung Woo.

  • How to fill the data of two different tables into one?

    Hi Experts,
    I have two tables named CDHDR and CDSHW(structure). I have extracted the  data from these two tables through two function modules named CHANGEDDOCUMENT_HEADER and CHANGEDOCUMENT_POSITION. Now I have the data in to different tables.
    These two tables neither has relationship with each other through any field nor have any field which exist in both. Can anyone tell me in this case what should be the process to take the data of both the tables into one table. How can I match the record of one table to another?
    thanks a ton in advance.
    Edited by: Moni Bindal on Apr 28, 2008 4:16 PM
    Edited by: Alvaro Tejada Galindo on Apr 28, 2008 1:42 PM

    Hye Bindal,
      without a relation, it is not possible to club the data of 2 internal tables. More over it depends on the requirement as to y u should club to non related quantities in an internal table.
    if you wish to do so, one thing is it has internal table which includes the strucute of the 2.
    data: begin of ty_out,
              first type first_structure,
              second type second_structure,
             end of ty_out.
    data: itab type standard table of ty_out.
    data: wa type ty_out.
    loop into it1 into wa1.
    move corresponding wa to wa1.
    append wa to itab.
    endloop.
    loop into it2 into wa2.
    move corresponding wa to wa2.
    append wa to itab.
    endloop.
    now the internal table itab will have all the contents of it1 and it2.
    <REMOVED BY MODERATOR>
    Thanks,
    Imran.
    Edited by: Alvaro Tejada Galindo on Apr 28, 2008 1:43 PM

  • From two given tables, how do you fetch the values from two columns using values from one column(get values from col.A if col.A is not null and get values from col.B if col.A is null)?

    From two given tables, how do you fetch the values from two columns using values from one column(get values from col.A if col.A is not null and get values from col.B if col.A is null)?

    Hi,
    Use NVL or COALESCE:
    NVL (col_a, col_b)
    Returns col_a if col_a is not NULL; otherwise, it returns col_b.
    Col_a and col_b must have similar (if not identical) datatypes; for example, if col_a is a DATE, then col_b can be another DATE or it can be a TIMESTAMP, but it can't be a VARCHAR2.
    For more about NVL and COALESCE, see the SQL Language manual: http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions119.htm#sthref1310
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002

Maybe you are looking for