Table mapping (KODO 3.4) using XDoclet

Hi,
I need to map an Object to a differntly named table via XDoclet. That is described in the [url http://edocs.bea.com/kodo/docs303/ref_guide_integration_xdoclet.html]Docs here.
When I use the foloowing class it will produce a different looking JDO file and KODO simply ignores it. Can you tell me, what I'm doing wrong?
Java Code:
* @jdo.persistence-capable
* identity-type="application"
* objectid-class="MyClassId"
* @jdo.class-vendor-extension
* vendor-name="kodo" key="detachable" value="true"
* @jdo.class-vendor-extension
* vendor-name="kodo" key="jdbc-class-map" value="base"
* @jdo.class-vendor-extension
* vendor-name="kodo" key="jdbc-class-map/table" value="MyTableName"
public class MyClass {...}
JDO file:
<class name="MyClass" identity-type="application" objectid-class="MyClassId" requires-extent="true">
<extension vendor-name="kodo" key="detachable" value="true">
</extension>
<extension vendor-name="kodo" key="jdbc-class-map" value="base">
</extension>
<extension vendor-name="kodo" key="jdbc-class-map/table" value="MyTableName">
</extension>
<field name="xxx" persistence-modifier="persistent" primary-key="false" null-value="none">
</field>
Update:
I also tried:
* @jdo.persistence-capable
* identity-type="application"
* objectid-class="MyClassId"
* table="MyTable"
public class MyClass {...}
But it seems, Kodo does not support the table attribute!
Update 2:
The upper solution should be the right one. It seems in the kodo.properties must be set the attribute "kodo.jdbc.MappingFactory: metadata"
Is anyone using such a table mapping that is working? I'm still struggeling to get this working!
Edited by jdeluxe at 05/16/2008 4:32 AM

Wow, I didn't expect almost 100 people watching this thread without any hint!
Here it is:
Ant Task
          <jdomappingtool action="refresh" sqlfile="XXX">
               <fileset dir="YYY" >
                    <include name="**/*.jdo" />
               </fileset>
               <config propertiesFile="D:/kodo-jdo-3.4.1/kodo.properties" />
EntityClass:
* @jdo.persistence-capable
*           identity-type="application"
*      objectid-class="foo.MyClassId"
*      name="myClass"
* @jdo.class-vendor-extension
*           vendor-name="kodo" key="jdbc-class-map" value="base"
* @jdo.class-vendor-extension
*           vendor-name="kodo" key="jdbc-class-map/table" value="MYTABLENAME"
* @jdo.class-vendor-extension
*           vendor-name="kodo" key="jdbc-class-map/pk-column" value="ID"
public class MyClass {
* description
* @jdo.field persistence-modifier="persistent"
* @jdo.field-vendor-extension vendor-name="kodo"
* key="jdbc-field-map" value="value"
* @jdo.field-vendor-extension vendor-name="kodo"
* key="jdbc-field-map/column" value="description"
private String description;
Note that when not using the explicit column mapping I experienced a strange behaviour: Kodo did not map to the existing table column, but wanted to add new fields postfixed with "1" (e.g. ALTER TABLE MYTABLENAME ADD COLUMN "description1").
Also the setting
kodo.jdbc.MappingFactory: metadata
in the kodo.properties file is mandatory !!!!!

Similar Messages

  • How to specify table name using xdoclet

    Hi
    I'm trying to specify a table name using xdoclet 1.2.
    I've tried the @sql.table, but that ain't working (no table mapping name is
    writen to the *.jdo)
    I've tried using the @jdo.class-vendor-extension with key=table and
    value=tablename, but that ain't working either.
    I guess number two approach ain't working because kodo want table name
    extension inside another extension like this:
    <extension vendor-name="kodo" key="jdbc-class-map" value="base">
    <extension vendor-name="kodo" key="table" value="tablename"/>
    </extension>
    But, how do I specify the above using xdoclet?
    Regards
    Jesper

    Ok.
    Is it possible somehow to just tell kodo to use another table name without
    having to create mapping extensions for collections and stuff. Even better
    if one could specify a table name prefix to be used on all tables.
    My problem is that I need use kodo on an existing database having tables
    names that conflict with kodo's auto-generated tables names. The schematool
    will then try alter these tables :-(
    Regards
    Jesper
    "Stephen Kim" <[email protected]> wrote in message
    news:[email protected]...
    When you use metadata mapping extensions, you should not generate
    .mapping files as all that info is stored in the .jdo file. You should
    instead set kodo.jdbc.MappingFactory to metadata.
    Jesper Ladegaard wrote:
    Thanks.
    However, I still can't get it to work.
    I've created a java class named Role with xdoclet like this:
    * @jdo.persistence-capable
    * @jdo.class-vendor-extension
    * vendor-name="kodo" key="jdbc-class-map" value="base"
    * @jdo.class-vendor-extension
    * vendor-name="kodo" key="jdbc-class-map/table" value="BW_ROLE"
    * @jdo.class-vendor-extension
    * vendor-name="kodo" key="jdbc-class-map/pk-column" value="JDOID"
    Xdoclet generates a jdo file like this:
    <jdo>
    <package name="dk.pine.users.services.model">
    <class name="Role"
    identity-type="datastore"
    <!-- end class tag --><extension vendor-name="kodo"
    key="jdbc-class-map"
    value="base">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-class-map/table"
    value="BW_ROLE">
    </extension>
    <extension vendor-name="kodo"
    key="jdbc-class-map/pk-column"
    value="JDOID">
    </extension>
    <field name="users"
    default-fetch-group="true"
    <!-- end field tag --><collection
    element-type="dk.pine.users.services.model.User"
    embedded-element="false"
    <!-- end collection tag --></collection>
    <extension vendor-name="kodo"
    key="inverse-owner"
    value="roles">
    </extension>
    </field>
    </class>
    </package>
    </jdo>
    Now I run the mappingtool (with option refresh) and it generates a
    mapping
    file like this:
    <mapping>
    <package name="dk.pine.users.services.model">
    <class name="Role">
    <jdbc-class-map type="base" pk-column="JDOID"
    table="dbo.ROLE0"/>
    <jdbc-version-ind type="version-number"column="JDOVERSION"/>
    <jdbc-class-ind type="in-class-name" column="JDOCLASS"/>
    <field name="description">
    <jdbc-field-map type="value" column="DESCRIPTION"/>
    </field>
    <field name="name">
    <jdbc-field-map type="value" column="NAME0"/>
    </field>
    <field name="systemRole">
    <jdbc-field-map type="value" column="SYSTEMROLE"/>
    </field>
    <field name="users">
    <jdbc-field-map type="many-many"
    element-column.JDOID="JDOID" ref-column.JDOID="ROLES_JDOID"
    table="dbo.USER0_ROLES"/>
    </field>
    </class>
    </package>
    </mapping>
    I expected it to create a BW_ROLE, but it create a ROLE0 table????
    "Stephen Kim" <[email protected]> wrote in message
    news:[email protected]...
    You can use slashes to denote sub extensions.
    See the example near the bottom of this link:
    http://solarmetric.com/Software/Documentation/3.0.3/docs/ref_guide_integrati
    on_xdoclet.html
    Jesper Ladegaard wrote:
    Hi
    I'm trying to specify a table name using xdoclet 1.2.
    I've tried the @sql.table, but that ain't working (no table mapping
    name
    >>
    is
    writen to the *.jdo)
    I've tried using the @jdo.class-vendor-extension with key=table and
    value=tablename, but that ain't working either.
    I guess number two approach ain't working because kodo want table name
    extension inside another extension like this:
    <extension vendor-name="kodo" key="jdbc-class-map" value="base">
    <extension vendor-name="kodo" key="table" value="tablename"/>
    </extension>
    But, how do I specify the above using xdoclet?
    Regards
    Jesper
    Steve Kim
    [email protected]
    SolarMetric Inc.
    http://www.solarmetric.com
    Steve Kim
    [email protected]
    SolarMetric Inc.
    http://www.solarmetric.com

  • Updating target table with date in owb using mapping

    I want to update the effetive begin date (month begin date) when we load the target table. I have field in target table has Eff_updated_dt defined as DATE.
    If I use the Data generator operator and then expression operator (trunc (sysdate,'mm' ) it giving error. It says data generator operator should be connected to flat file .
    What other operators can I use to update the column with month begin data.
    Also which operator I have use to have sequence key in the table.
    Thanks

    you can always use a constant for the date field.
    just create a constant of type date and give it the value you want, trunc (sysdate,'mm' ) and connect it to your target column, Eff_updated_dt defined.
    you have a sequence operator that you can use to link to your "sequence key" as well.
    Borkur

  • Import Server - Multiple Qualified Table - Map Crash

    Hello,
    Requirement: I need to update multiple qualified table using single source file.
    Preparation: I have created a map where mapping to multiple qualified table fields maually.
                       Have created a Inbound Port using the above map.
    Problem: Import server throws an exception; while opening the Import Manager using the Port Option and corresponding Exception; Lot of fields were un-mapped. Looks like Import map crashed.
    Please feel free to throw some light reg the same!
    Thanks
    Alexander

    Hi Alexander,
    If you are performing multiple qualifier table mapping and importing then you will hav eto create differnt map for each table importing.In that case you will rrquire multiple inbound ports and in each ports deatils you will give the map name pertaining to which qualified lookup table you wish to import.
    Actually using automatic importing for lookups is not desirable as the lookups always need to be prepopulated before your main table importing.
    The exception taht you are receiving could be due to the reason that the map you are saving is using only one table mapping and so most of the fields are left unmapped.
    try not to use automatic importing for Lookup qualifier tables and use manual importing and see if the the exception still comes.
    Hope it helps
    Kindly reaward points if found useful
    Thanks
    Simona

  • Help with multi-table mapping for one-to-many object inheritance

    Hi,
    I have posted on here before regarding this (Toplink mapping for one-to-many object inheritance but I am still having problems mapping my object model to my schema.
    Object model
    The Person and Organisation objects contain base information and have the primary keys person_id and organisation_id. It is important that there is no duplication of person and organisation records, no matter how many times they are saved in different roles.
    There are two types of licenceholder in the problem domain, and the ILicenceHolder interface defines information and methods that are common to both. The PersonalLicenceHolder object represents one of these types of licenceholder, and is always a person, so this class extends Person and implements ILicenceHolder.
    The additional information and methods that are required by the second type of licenceholder are defined in the interface IPremisesLicenceHolder, which extends ILicenceHolder. Premises licence holders can either be people or organisations, so I have two objects to represent these - PremisesLicenceHolderPerson which implements IPremisesLicenceHolder and extends Person, and PremisesLicenceHolderOrganisation which implements IPremisesLicenceHolder and extends Organisation.
    The model is further complicated by the fact that any single Person may be both a PersonalLicenceHolder and a PremisesLicenceHolderPerson, and may be so several times over. In this case, the same basic Person information needs to be linked to several different sets of licenceholder information. In the same way, any single Organisation may be a PremisesLicenceHolderOrganisation several times over.
    Sorry this is complicated!
    Schema
    I have Person and Organisation tables containing the basic information with the primary keys person_id and organisation_id.
    I have tried to follow Donald Smith's advice and have created a Role table to record the specialised information for the different types of licence holder. I want the foreign keys in this table to be licenceholder_id and licence_id. Licenceholder_id will reference either organisation_id or person_id, and licence_id will reference the primary key of the Licence table to link the licenceholder to the licence. Because I am struggling with the mapping, I have changed licenceholder_id to person_id in an attempt to get it working with the Person object before I try the Organisation.
    Then, when a new licenceholder is added, if the person/organisation is already in the database, a new record is created in the Role table linking the existing person/organisation to the existing licence rather than duplicating the person/organisation information.
    Mapping
    I am trying to use the toplink mapping workbench to map my PremisesLicenceHolderPerson object to my schema. I have mapped all inherited attributes to superclass (Person). The primary table that the attributes are mapped to is Person, and I have used the multi-table info tab to add Roles as an additional table and map the remaining attributes to that.
    I have created the references PERSON_ROLES which maps person.person_id to roles.person_id, ROLES_PERSON which maps roles.person_id to person.person_id and ROLES_LICENCE which maps roles.licence_id to licence.licence_id.
    I think I have put in all the relationships, but I cannot get rid of the error message "The following primary key fields are unmapped: PERSON_ID".
    Please can somebody tell me how to map this properly?
    Thank you.

    I'm not positive about your mappings, but it looks like the Person object should really have a 1:M or M:M mapping to the Licenceholder table. This then means that your object model should be similar, in that Person object could have many Licenses, instead of being LicenceHolders. From the looks of it, you have it set up from the LicenceHolder perspective. What could be done instead if a LicenceHolder could have a 1:1 reference to a person data object, rather than actually be a Person. This would allow the person data to be easily shared among licences.
    LicenceHolder1 has an entry in the LicenceHolder table and Person table. LicenceHolder2 also has entries in these tables, but uses the same entry in the Person table- essentially it is the same person/person_ID. If both are new objects, TopLink would try to insert the same person object into the Person table twice. I'm not sure how you have gotten around or are planning to get around this problem.
    Since you are using inheritance, it means that LicenceHolder needs a writable mapping to the person.person_id field- most commonly done through a direct to field mapping. From the description, it looks like roles.person_id is a foreign key in the multiple table mapping, meaning it would be set based on the value in the person.person_id field, but the person.person_id isn't actually mapped in the object. Check to make sure that the ID attribute LicenceHolder is inheriting from person hasn't been remapped in the LicenceHolder descriptor to a different field.
    Best Regards,
    Chris

  • FACT table Mapping

    I could not find a clear documentation on how to create a mapping to load CUBE
    after creating dimensions. I am using 10.1.0.2 version.
    I have two dimensions and one FACT table
    DIM1
    D1_sk
    other attributes
    DIM2
    D2_SK
    other attributes
    FACT
    D1_sk
    D2_sk
    measure attributes
    In previous forums I came across to use a lookup on dimensions
    to load the FACT table.
    But what would be my source to perform a lookup on Dimensions ?
    because My dimensions are the source for the FACT TABLE.
    Can I Join the DIMENSIONS to load the FACT TABLE?
    can any one suggest the right approach to creat a FACT table mapping.
    Thanks in advance.

    Hi,
    If you can tell what you are tying to achieve we can give some suggestions. You can use the same sources which you have used to load Dimensions, to load Fact table.
    Mahesh

  • Multiple Table Mapping To Single Entity in Workshop 8.1

    I've taken a test run on creating entity beans with workshop 8.1, although mapping
    an CMP entity to a single database table looks to be relatively straightforward,
    I can't seem to find a way to map multiple database tables to a single CMP entity
    (at least not via workshop). Do I have to manually modify the deployment descriptors
    after building with workshop?

    Thanks, John.
    Jingwei
    "John Reynolds" <[email protected]> wrote:
    >
    Jingwei Zhang <[email protected]> wrote:
    Is there any example of using ejbgen to map single EJB to multiple tables?
    Jingwei... I found this at: http://www.beust.com/cedric/ejbgen/#multiple-table-mapping
    By default, Entity beans are mapped to one table, with the attribute
    table-name
    on the tag @ejbgen:entity. If you want to map your Entity bean to more
    than one
    table, you can use the table-name attribute on individual @ejbgen:cmp-fields.
    All the CMP fields that do not have a table-name attribute will use the
    table
    specified on @ejbgen:entity (which can therefore be considered as the
    "default"
    table).
    If you want to map an Entity bean to several tables, you need to specify
    a comma-separated
    list of tables in the table-name attribute (and also on column). For
    example:
    * @ejbgen:cmp-field
    * column = "bal1, bal2"
    * table-name = "Table1, Table2"
    Make sure that the number of tables matches the number of columns, and
    that the
    columns exist in the corresponding table (for example, in the example
    above, Table1
    must contain column bal1, and Table2, bal2).

  • Table mapping Security???

    Hi,
    What is table mapping security in universe??? how to give that??please give an example??also what is connection security in universe designer??

    hi,
    Please refer below link (with examples)
    http://www.dataspace.com/Downloads/IA_Final_Sup_MD.pdf
    Lets say in Universe you are using Table1 earlier.  Now you want to map this to new Table called Table2.
    simply, you can replace a table referenced in the universe with another table
    Table Mapping feature helps to achieve this easily.
    Connection Security:
    Each universe has its name and connection. You can select another connection, or create a new connection for the universe. The connection for the universe specified in Access Restrictions applies to the user or group that is affected by the restriction.
    Regards,
    Vamsee

  • Data Load - Data / Table Mapping Columns Not Showing

    Hi,
    Using the new 4.1 functionality I have created a data load wizard.
    Everything seems to have created OK however when i run the wizard and get to the Data / Table Mapping stage (2nd page) the column names lov contains no list of values.
    The table i am trying to load in is in another schema but all the grants are there so that schema can view it.
    Any idea what I need to do or what I have missed so the columns can be viewed.
    Thanks in advance.

    Hi,
    You have to log in as admin and there should be an option to add schemas, once adding it should appear in the lov.
    This link should help.
    Parsing Schema

  • When I upload a cvs file not all the column display in the Data / Table Mapping screen

    1. I have created application using Apex Data Loading wizard. There when I am trying to load data from .csv file, but not all the columns display in the "Data / Table Mapping" screen. But if I go through AQL --> Utility --> Data Workshop, there all column display in "Data / Table Mapping" page. I want to get same thing in application I created. How will get all columns display in the screen?
    2. Is there any way to select target table dynamically during runtime. So that in appication we can select different target tables with different source file to load data.

    Your user info says iPad. This is the OS X Numbers forum. Assuming you are using OS X… Be sure the file is named with a .csv suffix.
    (I don't have an iPad, so I don't know the iOS answer.)

  • Nexus 7000 table map

    Hi, I perform a "show table-map cos-dscp-map" on a Nexus 7K and the output shows "default copy". My question is what is the "default copy" mapping? I am expecting to see a cos-dscp map like what we see on a Cat6500. But it's not the case. Checked the command and configuration guide, but can't seemt to find any useful information. Appreciate if someone can give some pointers on this. Thanks Eng Wee

    just an update. I was told by TAC the default-map cannot be displayed. But the switch will copy the first 3 bits of the dscp value to form the CoS. This CoS can then be used for egress queuing

  • File Browse Option don't show me all Column in Data / Table Mapping

    Dear Friends,
    i am using 4.1 on APEX.ORACLE.COM.
    i have to created page with DATA Upload option.Page are ctreated successfully But there is one problem when i COPY & PASTE DATA from Excel Sheet then Data Upload Success fully.
    But When I use File Browser Option to Upload Data Then In Data / Table Mapping Step that show me Only One Column Name Select list with Do Not Load default option . but i have 7 column name in Excel Sheet. that should be display me 7 Select List to select All column name which are mention in Excel Sheet
    Please tell me where i am wrong and how to display all Column name in Data / Table Mapping step to upload Excel Sheet Data.
    How to Resplve this issue.
    Thanks
    Manoj Kauhsik

    Dear Earl,
    Thanks to reply me.
    I am not using Utility to upl;oad Excel Sheet Data.
    i am go through Apex.oracle.com .i have create an application to upload data from Excel Sheet.
    There is an option DATA UPLOAD when we create new Page so i have choose this option and create Pages with follow all instraction .By using this option i want to an Feature in my Application to Upload Data .
    When i use Copy and Paste OPtion to upload data from Excel Sheet.then Data ar Uploaded but Problem Is When i use File Browser Option to upload data then that show me only one option for Column name rather than i have 7 Column in My excel file.
    i have one more problem ,i have .csv file when i open it and close then no problem but when i reopen it then that show me a pop up with Meassages
    "Excel has detected abc.csv file is a SYLK file.but can't load it".
    How resole it.Please suggest me.
    Thanks
    Vedant

  • How to get values from a table(in jsp) for validation using javascript.

    hi,
    this is praveen,pls tell me the procedure to get values from a table(in jsp) for validation using javascript.
    thank you in advance.

    Yes i did try the same ..
    BEGIN
    select PROD_tYPE into :P185_OFF_CITY from
    magcrm_setup where atype = 'CITY' ;
    :p185_OFF_CITY := 'XXX';
    insert into mtest values ('inside foolter');
    END;
    When i checked the mtest table it shos me the row inserted...
    inside foolter .. Now this means everything did get execute properly
    But still the vallue of off_city is null or emtpy...
    i check the filed and still its empty..
    while mtest had those records..seems like some process is cleaining the values...but cant see such process...
    a bit confused..here..I tried on Load after footer...
    tried chaning the squence number of process ..but still it doesnt help
    some how the session variables gets changed...and it is changed to empty
    Edited by: pauljohny on Jan 3, 2012 2:01 AM
    Edited by: pauljohny on Jan 3, 2012 2:03 AM

  • How to change co-ordinates of an internal table in page 1 & 2 using offline adobe forms?

    Hello All,
    How to change co-ordinates of an internal table(main window data) from page 2 onwards in offline adobe forms. For e.g., I need to print my internal table around 3-4 lines along with header&footer(only 1st page)in page 1. From 2nd page onwards Internal table should print header and use remaining page til end.
    Thanks in advance for your help.
    Thank you,
    Janakiram.

    Issue resolved...need to use content area option to achieve the same.
    Thanks,
    Janakiram.

  • Multi-Mapping and Message Split using BPM

    Hi All,
    Could anyone pls let me know clearly how message mapping can be done for this weblog
    /people/sudharshan.aravamudan/blog/2005/12/01/illustration-of-multi-mapping-and-message-split-using-bpm-in-sap-exchange-infrastructure
    Thanks,
    Ram

    Hi,
    When you are doing Message mapping after adding the Messaget types for source and target messages. You can click on the "" button in the target message and add one more tab. You can go to Message tab as shown in the 5th image and click "" button to add one more message type. Then do the mapping as usual.
    <b>Based on the value of the element(name), the node of input(details)should be directed to one of the two message types</b>
    Here in this blog it is done based on the Name.
    You need to use IFTHENELSE boolean function and do the mapping.
    Thanks,
    Prakash

Maybe you are looking for