How to use a MAP whithout join table

Hello
I am still evaluating KODO ;-)
I am using kodo 3.1.2 with an evaluation version
linux (kernel 2.6)
SUN JDK 1.4.2_04
MYSQL MAX 4.0.18 -Max
IDEA 4.0.3 and ANT 1.5.4 (to be exhaustive)
I am wondering how to configure the following mapping involving a Map. :
public class Translation {
private String locale;
private String txt;
public class TranslatableDescription {
/**Map of Key=locale as String; Value = {@link Translation}*/
==> private Map translations = new HashMap(); <==
public void addATranslation(Translation t){
translations.put(t.getLocale(), t);
file package.jdo :
<?xml version="1.0"?>
<jdo>
<package name="data">
<class name="Translation"/>
<class name="TranslatableDescription">
<field name="translations">
<map key-type="java.lang.String"
value-type="tutorial.data.Translation"/>
<extension vendor-name="kodo" key="jdbc-key-size" value="10"/>
</field>
</class>
</package>
</jdo>
The default Mapping generate a join table : TRANS_TRANSLATION which works
fine, but I would like to remove this table by adding a
colonne in the "TRANSLATION" table containing the JDOID of the
TRANSLATIONDESCRIPTION owner of this TRANSLATION.
I have made some try like this one in the mapping file
<class name="TranslatableDescription">
<field name="translations">
<jdbc-field-map type="n-many-map" key-column="LOCALE"
ref-column.JDOID="OWNERJDOID" table="TRANSLATION0"
value-column.JDOID="JDOID"/>
</field>
The schema generated in my DB is correct but when I try to persist some
objects I have the following Exception :
727 INFO [main] kodo.jdbc.JDBC - Using dictionary class
"kodo.jdbc.sql.MySQLDictionary" (MySQL 4.0.18'-Max' ,MySQL-AB JDBC Driver
mysql-connector-java-3.0.10-stable ( $Date: 2004/01/13 21:56:18 $,
$Revision: 1.27.2.33 $ )).
Exception in thread "main" kodo.util.FatalDataStoreException: Invalid
argument value, message from server: "Duplicate entry '2' for key 1"
{prepstmnt 8549963 INSERT INTO TRANSLATION0 (JDOID, LOCALESTR, OWNERJDOID)
VALUES (?, ?, ?) [reused=0]} [code=1062, state=S1009]
NestedThrowables:
com.solarmetric.jdbc.ReportingSQLException: Invalid argument value,
message from server: "Duplicate entry '2' for key 1" {prepstmnt 8549963
INSERT INTO TRANSLATION0 (JDOID, LOCALESTR, OWNERJDOID) VALUES (?, ?, ?)
[reused=0]} [code=1062, state=S1009]
java.sql.BatchUpdateException: Invalid argument value, message from
server: "Duplicate entry '2' for key 1"
     at kodo.jdbc.sql.SQLExceptions.getFatalDataStore(SQLExceptions.java:42)
     at kodo.jdbc.sql.SQLExceptions.getFatalDataStore(SQLExceptions.java:24)
     at kodo.jdbc.runtime.JDBCStoreManager.flush(JDBCStoreManager.java:594)
     at
kodo.runtime.DelegatingStoreManager.flush(DelegatingStoreManager.java:152)
     at
kodo.runtime.PersistenceManagerImpl.flushInternal(PersistenceManagerImpl.java:964)
     at
kodo.runtime.PersistenceManagerImpl.beforeCompletion(PersistenceManagerImpl.java:813)
     at kodo.runtime.LocalManagedRuntime.commit(LocalManagedRuntime.java:69)
     at
kodo.runtime.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:542)
     at
tutorial.CreateTranslatableDescription.main(CreateTranslatableDescription.java:48)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:324)
     at com.intellij.rt.execution.application.AppMain.main(Unknown Source)
I have the feeling that KODO does try to make diffent row in the table
"TRANSLATION0" for the TRANSLATION and the MAP.
So, is this kind of mapping supported by KODO and if yes, how can I
configure it.
Thank you for your help
Nicolas

So, is this kind of mapping supported by KODO and if yes, how can I
configure it.It is not directly supported. You can fake it using a one-many mapping
(see thread: Externalizing Map to Collection of PC), but unless you must
map to an existing schema, it's probably not worth the effort. (Note:
also there is a bug that actually prevents this from working with 3.1.2;
the bug is fixed for 3.1.3, but it hasn't been released yet).

Similar Messages

  • How to use pre-mapping process operator

    Hi,
    I am using OWB version 10.1.0.4.0.
    There are two source tables namely src1_tb(id1,field1,field2), src2_tb(id2,field3,field4) and a target table namely target_tb(id1,id2,field1,field2,field3,field4).
    It's a simple mapping with a join operator. Here, when I try to use a pre-mapping process operator 'LENGTH', with input from outgroup of join operator (field1) and output linked to an added field( VALUE_LENGTH) in Traget Table, it gives error "VLD-2451: Connection to premapping is invalid" and a warning "VLD-1008 :Referenced mapping column VALUE_LENGTH" does not exist"
    Can anyone please let me know how to use pre-mapping process operator.
    Any help will be greatly appreciated.
    Regards,
    Pawan

    yes, a pre-mapping procedure is not what you want here.
    Pre-mapping procedures run once when the mapping initializes and before the actual ETL is run. IT is a place where you could do some custom data cleansing / validation, populate your own audit loggin tables if you wish, or whatever other things you might like to do.
    For what you are describing, you want to pass the field through an expression object. Drop the Expression on the canvas and drag a link from the field in your OUTGRP to the INGRP on the expression This will auto-create the corresponding ingrp attribute in the expression for that field. Then double-click the expression object to bring up it's properties sheet. You will then want to create an OUTGRP attribute called length_value of type number, and set it's Expression property to length(ingrp1.your_Field_name_here). You can then connect from this outgrp field to your field in the target table.
    Cheers,
    Mike

  • How to use Google Maps by Visual Composer?

    Hi all,
    I'm creating some simple applications by Visual Composer in which I wanna use a Google Maps in VC,
    and i have now successfully got to the STREET, POSTL_CODE, CITY and COUNTRY came from the BAPI.
    (i am trying to use the Bapi_Customer_Getdetail2.)
    but,i didn't get how to connect Table View and Html View.
    I have already checked the below links. but i fail to understand how to do it.
    Re: Google Map and VC
    Help on google maps
    https://wiki.sdn.sap.com/wiki/display/VC/Using%2bGoogle%2bMaps
    I have many unknowns, could you tell me how to use Google Maps by VC.
    (* About Our VC viersion : SAP NetWeaver Visual Composer EHP1 SP2 for SAP NetWeaver 7.1)

    Some thread are say that create the URL fields. like the below messages.
    The STREET, POSTL_CODE, CITY and COUNTRY come from your BAPI. The other variables url* are default values to create the URL that is requiered for walweb.
    URL1 'http://walweb.nl/walweb/picsfromspace/maps.php?LanguageRadio=dutch&AddressInput='
    URL2 '&ZipcodeInput='
    URL3 '&StateInput=&CitycodeInput=&CityInput='
    URL4 '&CountrySelect='
    URL5 '&ZoomSelect=17&PoiInput=hidden&PoiButton=Interessante+Punten'
    Where should I create those fields? at the Table Vies?
    and also i dont get where should i set the below. is that setting at the [[Map Data]]-[[Assigned Value]]??
    STORE@Url1 & @STREET & STORE@Url2 & @POSTL_CODE & STORE@Url3 & @CITY & STORE@Url4 & @COUNTRY & STORE@Url5
    best regards,
    Masahiro Minagawa

  • Can somebody post link to How to Use ABAP-Mapping in XI 3.0?

    Hello,
    can somebody post a real link to the document How to Use ABAP-Mapping in XI 3.0. All the links to this documnet in the existing posts are not valid.
    Thanks for your information
    Jayson

    Hi
    Following weblog might help you.
    Testing ABAP Mapping - Testing ABAP Mapping
    XML DOM Processing in ABAP part I -  Convert an ABAP table into XML file using SAP DOM Approach.
    /people/r.eijpe/blog/2006/02/19/xml-dom-processing-in-abap-part-iiia150-xml-dom-within-sap-xi-abap-mapping
    SDN TV demo to create and test ABAP mapiing - https://media.sdn.sap.com/SDNTV/main.asp?mediaId=128
    How to guide for ABAP mapping.
    https://websmp106.sap-ag.de/~form/sapnet?_SHORTKEY=01200252310000071155&
    Also check these links,
    http://help.sap.com/saphelp_nw04/helpdata/en/ba/e18b1a0fc14f1faf884ae50cece51b/content.htm
    Testing ABAP Mapping
    Using ABAP XSLT Extensions for XI Mapping
    Thanks
    Gaurav
    Edited by: Gaurav Bhargava on Oct 9, 2008 6:27 AM

  • How to use image maps in ADF 11g

    Can somebody point me to code snippet for using image maps in JSF Page.
    I just want to use image maps in my application..but i don't know how to use image maps in ADF.
    -Deepti

    Hi chris,
    My DataBase script is given in below
    CREATE TABLE XXSR.SR_HIERARCHY
    FORM_ID NUMBER,
    FORM_NAME VARCHAR2(30 BYTE),
    PARENT_FORM_ID NUMBER,
    FORM_LOCATION VARCHAR2(1000 BYTE),
    IMAGE_FILE ORDSYS.ORDIMAGE
    I want to store the image in database from front end using ADF 11g
    -Deepti
    Edited by: 913387 on Feb 24, 2012 5:36 AM

  • How To Guide on ABAP mapping (How to Use ABAP-Mapping in XI 3.0).

    Hi,
    I am looking for this document: How To Guide on ABAP mapping (How to Use ABAP-Mapping in XI 3.0), and not able to find it.
    Can anybody please point me the location, to look for, or post the document.
    Thanks,
    Namadev

    Hi Namadev Chillal  ,
    These r the links containing PDF docs which u r looking for:
    how to create a flat file out of an IDoc-XML by means of an ABAP mapping program and the J2EE File Adapter.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/46759682-0401-0010-1791-bd1972bc0b8a
    Excellent PDF Document on Mapping
    http://help.sap.com/bp_bpmv130/Documentation/Operation/MappingXI30.pdf
    Mapping Development with the ABAP Workbench
    http://help.sap.com/saphelp_nw04/helpdata/en/10/5abb2d9df242f6a62e22e027a6c382/content.htm
    ABAP Mappings
    http://help.sap.com/saphelp_nw04/helpdata/en/ba/e18b1a0fc14f1faf884ae50cece51b/content.htm

  • How TO Use Java Mapping In XI

    Hi Experts,
    please help me ,
    How TO Use Java Mapping In XI?
    Thanks
    Mahesh

    Hi,
    Just refer the following links for java mapping:-
    1./people/thorsten.nordholmsbirk/blog/2006/08/10/using-jaxp-to-both-parse-and-emit-xml-in-xi-java-mapping-programs
    2./people/alessandro.guarneri/blog/2007/03/25/xi-java-mapping-helper-dom
    Regards,
    Ashwin M
    Reward if helpful

  • How to use Bex Map??

    Hi
    I'm new to using Bex Map.
    Can anyone explain to me step by step how to use Bex Map.
    I have created a cube in RSA1 already. All the data is loaded.
    I know on the object on the business explorer tab there is things that need to be done there.
    Can someone explain to me how? The steps? Also where does one get the actual maps?
    Will reward anyone that shows me in detail how to do it.
    Thanks in advance

    Hi Louis,
    Check this link might be useful:
    http://help.sap.com/saphelp_nw04/helpdata/en/80/1a65dce07211d2acb80000e829fbfe/frameset.htm
    Also check these links:
    http://help.sap.com/saphelp_nw04/helpdata/en/1a/f405387bcc513be10000009b38f8cf/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/07/79053950c48e05e10000000a114084/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/63/79053950c48e05e10000000a114084/frameset.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f0f709eb-2bbd-2a10-7aa0-d484d344e8ec
    Hope this helps...........
    Rgs,
    I.R.K

  • How will use Select-Options in Read table Concept.

    Hi All,
                  How will use Select-Options in Read table. For  example,
          Select-Options : test for bseg-prctr.
           Select * from bseg into table ITAB.
    Read table ITAB with key prctr in test.
    Last line is showing error. If any way to read ITAB as conditions given per select options.
    Thankx Advance,,,

    HI,
    you cannot use " IN " with read statement , read statement is used as:
    READ TABLE it_collect  ASSIGNING <fs_collect>
                      WITH KEY   rbpl = <fs_wkdet>-arbpl
                                 ufnr = <fs_wkdet>-aufnr.
    anyways you can use  loop at statement before read to use  " into "  statement as:
    LOOP AT it_master INTO l_master
                                           WHERE werks       = l_werks
    hope it will help you
    regards
    rahul
    Edited by: RAHUL SHARMA on Dec 30, 2008 9:14 AM

  • How to use Nokia maps

    Hi,
    I have Nokia 7510 Supernova Model, I would like to know how to use Nokia maps in it. I tried using Navicore Extenal Bluetooth ( Wayfinder), but i couldnt use it. Is there any way to use maps in Nokia.

    Hi mdmalik
    Provided this isn't a typographic error for 7610 Supernova, unfortunately you cannot use Nokia Maps on your S40 device. You could use application such as Nav4All although you would need to download data with asscociated costs:http://www.nav4all.com/site2/www.nav4all.com/index.php
    Happy to have helped forum in a small way with a Support Ratio = 37.0

  • Explain How to use Structure mapping button

    Hi All
    Iam Developing an application "Implementing and Using Exceptions in Guided Procedures"
    Can you please explain How to use Structure mapping button,
    Plz give me steps in details
    Thanks
    Srinivas

    Hi
    Create a project using 0020 as method.
    Max

  • How to use JSTL create a dynamic table according to a database???

    How to use JSTL create a dynamic table according to a database in a web page? Who can help me? Thanks.

    How to use JSTL create a dynamic table according to a
    database in a web page? Who can help me? Thanks.???
    Could you rephrase your quesion?
    Do you want to display records by reading from a table in DB?

  • How to use a variable as a table name in PL/SQL?

    Hello all.
    I was given one day to wrote a piece of PL/SQL code to do a query. That is,
    First select two columns from one table and use them to build another table's name, then
         join the two tables. I'm not sure if variables can be used in the select list, if possible,
         how to reference them?
    -- My code is
    DECLARE
         tablename varchar2(40);
         CURSOR c1 IS
    select a.sourcesystemcode, a.adminorganizationno from cdb1.organization_mapping a
    where exists( select 1 from cdb1.organization_mapping b where
    a.cdborganizationno = b.cdborganizationno and a.adminorganizationno != b.adminorganizationno)
    order by a.cdborganizationno,a.adminorganizationno;
         v_src_sys_cod cdb1.organization_mapping.sourcesystemcode%TYPE;
         v_adm_org_no cdb1.organization_mapping.adminorganizationno%TYPE;
    BEGIN
    OPEN c1;
    LOOP
    FETCH c1 INTO v_src_sys_cod, v_adm_org_no;
    EXIT WHEN c1%NOTFOUND;
    tablename := 'ODS1.SRC_' || v_src_sys_cod || v_adm_org_no || 'ACTORG_CURR';
    select c.cdborganizationno, c.sourcesystemcode, c.adminorganizationno, c.sourceorganizationno, d.ibkcde, d.orgnam
    from cdb1.organization_mapping c inner join tablename d on c.sourceorganizationno = d.orgidt;
    END LOOP;
    CLOSE c1;
    END;
    The error message says "... the table or view does not exist... line 18, column 66..."
    It says the variable "tablename" wasn't build or build incorrectly.
    Please give the solution.

    If the TABLEs being queried are already known, and it is just a matter of which one to query, perhaps you can CREATE a VIEW that uses all the TABLEs with a UNION ALL, and include an identifier COLUMN.
    CREATE VIEW SRC_ALL_ACTORG_CURR
    AS
    SELECT 'aa' Name, ibkcde, orgnam FROM SRC_aa_ACTORG_CURR UNION ALL
    SELECT 'bb' Name, ibkcde, orgnam FROM SRC_bb_ACTORG_CURR UNION ALL
    SELECT 'cc' Name, ibkcde, orgnam FROM SRC_cc_ACTORG_CURR UNION ALL
    SELECT 'dd' Name, ibkcde, orgnam FROM SRC_dd_ACTORG_CURR UNION ALL
    SELECT 'ee' Name, ibkcde, orgnam FROM SRC_ee_ACTORG_CURR;
    Then, in you query:
    select c.cdborganizationno, c.sourcesystemcode, c.adminorganizationno, c.sourceorganizationno, d.ibkcde, d.orgnam
    from cdb1.organization_mapping c inner join SRC_ALL_ACTORG_CURR d on c.sourceorganizationno = d.orgidt and d.Name = v_src_sys_cod || v_adm_org_no;

  • MAP Toolkit - How to use this MAP tool kit for all SQL Server inventory in new work enviornment

    Hi Every one
     Just joined to new job and planning to do Inventory for whole environment so I can get list of all SQL Server installed . I downloaded MAP tool kit just now. So looking for step by step information to use this for SQL Inventory. If anyone have documentation
    or screen shot and can share would be great.
    Also like to run It will be good to run this tool anytime or should run in night time when is less activity? 
    Hoe long generally takes for medium size environment where server count is about 30 ( Dev/Staging/Prod)
    Also any scripts that will give detailed information would be great too..
    Thank you 
    Please Mark As Answer if it is helpful. \\Aim To Inspire Rather to Teach A.Shah

    Hi Logicinisde,
    According to your description, since the issue regards Microsoft Assessment and Planning Solution Accelerator. I suggestion you post the question in the Solution Accelerators forums at
    http://social.technet.microsoft.com/Forums/en-US/map/threads/ . It is appropriate and more experts will assist you.
    The Microsoft Assessment and Planning (MAP) Toolkit is an agentless inventory, assessment, and reporting tool that can securely assess IT environments for various platform migrations. You can use MAP as part of a comprehensive process for planning and migrating
    legacy database to SQL Server instances.
    There is more information about how to use MAP Tool–Microsoft Assessment and Planning toolkit, you can review the following articles.
    http://blogs.technet.com/b/meamcs/archive/2012/09/24/how-to-use-map-tool-microsoft-assessment-and-planning-toolkit.aspx
    Microsoft Assessment and Planning Toolkit - Technical FAQ:
    http://ochoco.blogspot.in/2009/02/microsoft-assessment-and-planning.html
    Regards,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • How to use dynamic query for Result table

    Hello Experts,
    I want to use dynamic query and then display the result in the assignment block.
    Using dynamic query BTQAct and BTQRAct and base on some search criteria i want tofilter and then append the result in the result table of that custom context node, and then it should display the result in the view in UI.
    SO can you please provide me the samplle code on how to use the dynamic query and append in the result table.
    Regards.

    Hi,
    Please find below sample code:
    data:  query         TYPE REF TO cl_crm_bol_dquery_service,
               result        TYPE REF TO if_bol_bo_col.
    DATA: lt_params       TYPE crmt_name_value_pair_tab,        
               lwa_params      TYPE crmt_name_value_pair.             
    query = cl_crm_bol_dquery_service=>get_instance( 'BTQAct' ). " Get instance of dynamic query
    Set general query parameter for maximum number of hits
          lwa_params-name = 'MAX_HITS' .
          lwa_params-value = '50'.
          APPEND lwa_params TO lt_params.
          query->set_query_parameters( it_parameters = lt_params ).
          query->add_selection_param( iv_attr_name = 'OBJECT_ID'
                                                    iv_sign      = 'I'
                                                    iv_option    = 'EQ'
                                                    iv_low       = <lv_objectid>
                                                    iv_high      = '' ). " Set your search criteria. Repeat this code if you have multiple parameters
    "You can find possible search options for a query object in  GENIL_BOL_BROWSER
    result ?= query->get_query_result(  ).   " Get result from your search query
    me->typed_context-> <your result context node>->set_collection( result ). 
    Here you will have to create a context node in your view which would refer to query result object like for BTQAct its BTQRAct                      
    Hope this helps.
    e Regards,
    Bhushan

Maybe you are looking for

  • Safari takes ages contacting websites

    I have recently purchased a macbook pro. I also have a powerbook g4. Both are used on the same wireless network but for some reason the powerbook loads pages much faster in safari. The macbook pro seems to stall when prompted to load a page for examp

  • Some problems in finding answers of interview questions Oracle SOA 11g

    hi These questions were asked from me in an interview. could someone please help me to get the answers? Q1: While using a file adapter if we have declared an elements schema length as 100 and file reading the file adapter that element contains 120 ch

  • My iTunes Library Duplicates

    My iTunes Library is displaying two versions of every song. How do I delete 1 leaving a single copy of each song in the Library. Thanks revds

  • Error: no jmvfw in java.library.path

    Hello Exception in thread "VFW Request Thread" java.lang.UnsatisfiedLinkError: JMFSecurityManager: java.lang.UnsatisfiedLinkError: no jmvfw in java.library.path      at com.sun.media.JMFSecurityManager.loadLibrary(JMFSecurityManager.java:206)      at

  • Phototshop Elements ver. 11.0 color picker tool misfiring- help!

    The color picker tool is suddenly not working correctly in photoshop elements editor ver. 11.0. I've reset the tool, reset all tools and closed/ opened the program several times. Still not woring correctly- help ?