How to mapping domain tables

Hi,
I am new one to Kodo and have a question about how to mapping with FK of the domain tables. For example, the magazine table has a fk refering to publisher table. So, the Magazine object has mag_id (pk) and publisher (fk, object of Publisher). The Publisher will have pub_id as pk. What kind of mapping it needs? By the way, the database has fk constraints on.
Thanks in advance,
Michael

pk means primary key and fk means foreign key. I use kodo-jdo-3.4.1.
You are right, the example is similar to the example in the user guide. Table magazine has mag_id as pk, publisher_id, a foreign key constraint with table publisher, and other columns. So, the publisher table is a domain table. The database has non-deferred foreign key constraint.
I define the following classes:
class Magazine
String mag_id; //pk
Publisher pub;
class Publisher
String pub_id; //pk
I use one-one mapping at field pub of Magazine to publisher as Column.PUB_ID = "PUB_ID" in mapping file. However, it doesn't work.
When I try to insert a new magazine record into magazine table, the database will check table Publisher for foreign key constraint, and then the kodo will automatically try to insert a new record into publisher table.
I know something wrong in my mapping. What should I do?
Thanks,
Michael

Similar Messages

  • How to map 2 tables together into a new one, like an Union?

    Hi.
    I am new in Oracle Data Warehouse Builder and what I'm wanting to do could be simple.
    My question is: How to map 2 tables into a new one? That is, what I need is to do a Union.
    See the following tables:
    What I have is:
    ---------------+ ---------------+
    | A | B | | A | B |
    |--------------- |---------------
    | 10 | 34 | | 13 | 39 |
    ---------------+ ---------------+
    Table 1 Table 2
    What I wish is:
    ---------------+ ----------------------+
    | A | B | Original table |
    |--------------- ----------------------+
    | 10 | 34 | 1 |
    |--------------- ----------------------+
    | 13 | 39 | 2 |
    |--------------- ----------------------+
    Then, I need put all data together into a new table and this new table should has a new column showing the original source of data to each record.
    Can I do such thing?
    I'm using the Oracle Warehouse Builder and trying to do a map in this way.
    Any hint will be very helpful. I also will appreciate an indication of some document which can show how to do it.
    Thanks .
    Rodrigo Pimenta.
    Brazil.

    Use the SET OPERATOR. That should help i guess.

  • How to map lookup table

    Hi friends,
    I did this simple report in obiee 10g(i.e)
    *"NATIONALITY COUNT IN DEPARTMENT WISE"*
    For that i used the following tables:
    per_all_assignments_f----->fact table
    hr_all_organization_units----->dim table(containing departments)
    per_all_people_f---------------->dim table(containing nationality)
    I made all the mappings in the physical diagram, as also viewed my report in BI answers
    It shows the following results like
    NATIONALITY---------------------------------------------------------------------COUNT(NATIONALITY)
    AUS------------------------------------------------------------------------------------------------24
    AFR------------------------------------------------------------------------------------------------25
    PHQ_VB-------------------------------------------------------------------------------------------40
    SH_VT----------------------------------------------------------------------------------------------4
    The problem is for me it is showing the above results, but the nationality column is of various codes of the country.
    Since i doesnt want the code of the nationalitian to display in the results..i need the meaning of each and every nationality..
    like,
    AUS------------------------Australian
    AFR-------------------------African
    PHQ_VB----------------------Germanian(assigned)
    Since i know that the meaning for the nationalitian is available in "FND_LOOKUP_VALUES"...okay..
    I can import "FND_LOOKUP_VALUES" table to the physical layer...but how i can able to give the mapping to the fact table in my physical diagram...
    In my report the fact table is "per_all_assignments_f"
    As my fact table doesnt contains any matching column corresponding to the dimension table "FND_LOOKUP_VALUES".....
    Then how i can give mappings to the fact column???? for viewing the full meaning of the nationalitian in my report.....
    Help me friends...
    All izz Well
    GTA...

    Hi Kranthi,
    Thanks for your reply....
    For the meaning to appear for each and every nationalitian i imported the HR_LOOKUPS table and i have given join to the per_all_people_f which is an dimension table.....
    This is the following query that i executed in toad for getting meaning for each and every nationality...
    select distinct h15.meaning, h15.lookup_code from hr_lookups h15, per_all_people_f papf, per_all_assignments_f paaf
    where h15.lookup_type(+) = 'NATIONALITY'
    AND h15.lookup_code(+) = papf.nationality and h15.meaning is not null and papf.person_id = paaf.person_id The samething i implemented in obiee, that is in physical diagram i have given the join between hr_lookups and per_all_people_f..
    like the lookup_code column in hr_lookups table and nationality column in the per_all_people_f table
    i obtained the results in BI answers, but i didnt get accurate result........
    Since for getting the accurate result i need to give one more join between the hr_lookups table and per_all_people_f table........
    This is the join i need to give to obtain accurate result that i have already mentioned in the above query...
    > h15.lookup_type(+) = 'NATIONALITY'
    since OBIEE is not allowing me to given a second join from the lookup table to the people table...then how i can able to obtain accurate result in BI answers......
    Is there anyother way to give second join between the same two tables in my case between hr_lookups and per_all_people_f..
    Please Help me with this......
    Thanks for your support.....
    All izz Well
    GTA...
    Edited by: GTA on Feb 17, 2011 1:15 AM

  • How to map a table with out a primary key with a pojo?

    hello
    Is it possible to map a pojo with a table, table don't have primary key. I m using hibernate,How to do that in hibernate.
    Thanks &Regards
    snimi

    Hello,
    EclipseLink has support for database object-relational datatypes, but they are not supported or exposed through JPA. Instead, you will need to leave it unmapped and then change the mapping, using a customizer to create the mapping described:
    http://wiki.eclipse.org/Introduction_to_Object-Relational_Data_Type_Mappings_(ELUG)#Object-Relational_Data_Type_Array_Mapping
    Best Regards,
    Chris

  • How to map primary table for CMP?

    I am using the SunONE studio EE and trying to deploy a CMP Entity bean and get the following error:
    Validation failed for board.ejb.user.UserBean. Verify that all fields are mapped.
    CMP Mapping Error in bean User:: Warning: The bean pcImpl0.moduleComp0.board.ejb.user.User is not mapped.
    Set the primary table for the bean.
    I have the CMP resou4rce set to the JNDI name of my database connection but I can't figure out hpw to set the primary table for the bean. Any help would be apprecieated.

    You will need to do the mapping via the UI available on the bean (in the context of the module).
    If you expand the ejb-module, you can select a bean that is in that module.
    There are two SunONE App Server specific tabs added to the property sheet for a vselected CMP bean.
    Entering data for these properties will do the mapping and resolve the error you are encountering.
    Note: The current implementation does not conjure up tables for the entity beans (unlike the RI).

  • How to map a table in a query?

    For DUET 1.0 (not FP1), GW 1.0, for the query, I am trying to allow the user to pass in an array of values for purchase order/purchase order item combinations.  I would like to have the request look something like this:
    <n0:ZfiPoClose xmlns:n0="urn:sap-com:document:sap:soap:functions:mc-style">
    <IsInput>
      <PoPoItemList>
       <item>
        <PoNumber>10005543</PoNumber>
        <PoLineItem>1</PoLineItem>
       </item>
       <item>
        <PoNumber>10005543</PoNumber>
        <PoLineItem>2</PoLineItem>
       </item>
       <item>
        <PoNumber>85005572</PoNumber>
        <PoLineItem>1</PoLineItem>
       </item>
      </PoPoItemList>
      <PoCloser>andyg</PoCloser>
    </IsInput>
    <IvBcscorrelationid>12345</IvBcscorrelationid>
    <IvLastId></IvLastId>
    <IvMaxHits>8</IvMaxHits>
    </n0:ZfiPoClose>
    I get a short dump on this.  I debugged into the SAP code and it appears like there might a way to format the item nodes something like a range.  Does someone know the secret here?  I have looked through the documentation and haven't found anything on this.

    I have figured this out by reverse engineering the SAP code.  You will need a 5 field stucture to hold you values where the 3rd field has the name INTERVAL_BOUNDARY_TYPE_CODE.  This is sort of like a range structure in that the 4th and 5th fields are the low and high values.  Although there are several ways to do this, I decided to use the low value for the PO Number and the high value for its associated line item.  This means that the INTERVAL_BOUNDARY_TYPE_CODE has to be 3 (3 means between).  I know these values are not really u201Cbetweenu201D, but to the requestor the structure looks like something they would fill in, i.e.
    Field Name                                                                        Description
    DUMMY1                                                                           Dummy field, leave empty
    DUMMY2                                                                           Dummy field, leave empty
    INTERVAL_BOUNDARY_TYPE_CODE                             Set value to 3
    PO_NUMBER                                                                     Set value to PO number
    PO_LINE_ITEM                                                                   Set value to PO line item associated with above PO number
    Go to METHOD map_interval in Class /IWFND/CL_CAL_FLAT_IB_GEN_MAP to see how they are doing it.
    There should be a write up somewhere in SAP for this, but I did not find anything!

  • How to map ECC Infoset Query to Crystal Report

    Hi All,
    I am using 25 standard SAP crystal reports which have been mapped on the top of ECC system. Some of reports are working well but some are not working due to unable to find query. The name of the report is Controlling Dashboard report and it has CO_OM_CA_20_Q1 query which I was unable to map on ECC using Crystal Report. I do not knw how to map ECC table infoset to Crystal report.
    Can anybody assist me to get solution?

    Hi Efstratios,
    Hope you are well!
    I am experiencing the same issue:
    unable to get this infoset query CO_OM_CA_20_Q1 in Crystal Report which is made on the top of ECC
    I followed the BI quick guide as well, I am on EPH 4 and I am able to see both the Query Infoset CO_OM_CA_20_Q1 and its related Infoset /SREP/CO_OM_CCA_20.
    But unfortunately, it wouldn't let me update the connection approprietaly.
    Is this something you can assist me with?
    Thanks in advance
    Yann

  • How to use error table in mapping level?

    Hi all
    Any one please tell me how to use error table in mapping level or how to handle the errors in mapping.
    I am creating one error table in oracle but i dont know how to use it in mapping.
    Thanks in advance.
    Kumar

    Hi Kumar,
    You need to use Error Table along with the Data Rule .
    Error tables are used with Logical error handlers (Data Rules). Detailed description on using data rules is explained in the following document
    http://www.oracle.com/technology/products/warehouse/pdf/OWB10gR2_ETLandBusinessRules.pdf
    In a nut shell usage of error tables is as follows.
    1. Create a data rule associate it with a table (Target table or table in which you load data).
    2. Use the table in a mapping as target table.
    3. Deploy the table and mapping.
    Now in the target schema one more table will be created with the name <target table name>_ERR. When a mapping is executed the data which violates the data rule gets into this error table.
    The following has to be done to have error table name of customers choice.
    1. Right click on the table and click configure.
    2. Give the table name in "shadow table name" section.
    3. Deploy the table.
    4. Use this table in a mapping. Now in the mapping on this table properties in "Error Table Name" section the name of the table specified in "shadow table name" will be populated.
    Thanks,
    Sutirtha

  • How to map XML File input to VO (eventually to update table) upon fileupld

    Reqirement: I am downloading an XML File (basically name-value pair) from user using OAMessageFileUploadBean. I need to take this file and update to an existing record in the table (cs_incidents_all). XML File schema is well-known in advance.
    Approach: Don't know what is the best, but I'm thinking if there is an OAF way to map the XML File (Blobdomain) to VO and get the rowIMPL.getColumn1Value to fetch all the datavalues then loop thru all the columns (xml-tags) and finally call plsql APIs which will update/insert into table (cs_incidents_all)
    Is this possible in OAF? If so please shed some light as to how to map XML File to VO.
    If this is not possible then please let me know the other way. I have to do this inside the oaf.
    Thank you,

    Can someone please let me know if this is possible in OAF?

  • How to map an object to its ID in a table?

    Here is my situation:
    class Foo {
      private Bar bar;
    }How to map the Bar object into a DB table column of its ID on the ORM mapping file?
    Thanks very much in advance.

    Never mind. I have solved this issue myself.
    Message was edited by:
    vwuvancouver

  • My requirement is to update 3 valuesets daily based on data coming to my staging table. What is the API used for this and how to map any API to our staging table? I am totally new to oracle and apps. Please help. Thanks!

    My requirement is to update 3 valuesets daily based on data coming to my staging table. What is the API used for this and how to map any API to our staging table? I am totally new to oracle and apps. Please help. Thanks!

    Hi,
    You could use FND_FLEX_LOADER_APIS.UP_VALUE_SET_VALUE to upload them from staging table (I suppose you mean value set values...).
    You can find a sample scripts if you google around.
    What do you mean "how to map any API to our staging table" ?
    You should do at least the following mapping (which column(s) in the staging table will provide these information):
    - the 3 value sets name which you're going to update/upload (I suppose these are existing value sets or which have been already created)
    - the value set values and  description
    Try to start with something and if there is any issues the community could then help... but for the time being with the description of the problem you have provided, that's the best I can do...

  • How can I see in what maps some table is used?

    Hi,
    Anyone can tell me how can I see in what maps some table is used, without open all of then?
    Thanks,
    Gustavo.

    Good morning Gustavo,
    OWB has some public views defined which can provide you with this information. Check Appendix D (Warehouse Builder Public Views) of the OWB User Guide for all info.
    Log in as the owner of the design time repository, if you run the following query you'll have a basic overview of whic table is used in which mapping:SELECT MAP_NAME         MAPPING_NAME
    ,      DATA_ENTITY_NAME TABLE_NAME
    ,      BUSINESS_NAME    TABLE_OPERATOR_ALIAS
    ,      DESCRIPTION      TABLE_OPERATOR_DESCRIPTION
    FROM   ALL_IV_XFORM_MAP_COMPONENTS
    WHERE  DATA_ENTITY_TYPE = 'TABLE'Good luck, Patrick

  • 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 copy FDM setting (import format, dimension mapping, control table)

    Dear All,
    How to copy FDM setting (import format, dimension mapping, control table) from application to another application.
    I found that only dimension mapping can be imported. Is there any way to copy FDM application quickly?
    Thanks your help

    If you get a chance try the following script, it's so simple and easy to extract all the map data to XML and will help in to import back through Import script.
    Sub MapExtractor()
    'UpStream WebLink Custom Script:
    'Created By:      SatyaK
    'Date Created:      12/08/09
    'Purpose: This Script will produce a Account Map File for
    '                         the current location.
    'Execute the export
    strFilePath = API.IntBlockMgr.InterfaceMgr.fExportMapToXML("File Path", PPOVPeriod)
    End Sub
    -------------

  • How to map single input value to Two columns of Database table using format file of Bulk Copy Process

    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,
    Sudhakar

    From 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.

Maybe you are looking for