Horizontal Mapping and Flat mapping with Metadata Value Indicator

Hi
I have an abstract class B which itself extends another abstract class A.
There is no table for A. The fields in A are mapped to B. I believe this
is called "horizontal mapping"
C and D inherit off B. There's a also a table named B (mapped to class B),
but none for C or D. Instances of C and D are recorded in table B. I
believe this is called "flat mapping"
B has a field foo whose possible values are 'fred' and 'wilma'.
If foo='fred', then the record is of type C
If foo='wilma', then the record is of type D
I believe this is called "class indicator" of type metadata.
To express this, I have package.jdo which says
<class name="A"/>
<class name="B" persistence-capable-superclass="A"/>
<class name="C" persistence-capable-superclass="B"/>
<class name="D" persistence-capable-superclass="B"/>
In B.mapping, I have
<mapping>
<package name="domain">
<class name="B">
<jdbc-class-map type="horizontal"/>
<jdbc-class-ind type="metadata-value" column="foo"/>
</class>
</package>
</mapping>
B.java has a private String foo.
In C.mapping, I have
<mapping>
<package name="domain">
<class name="C">
<jdbc-class-map type="flat"/>
<jdbc-class-ind-value value="fred"/>
field mappings for C
</class>
</package>
</mapping>
and similarly in D for value='wilma'
My questions are...
1. Is this kind of mapping supported by kodo?
2. If so, is this configuration correct? I guess not, since I don't
specify the table name anywhere. Where should it go?
3. If I remove the "class indicator" mapping and run a simple test I get
kodo.util.FatalUserException: There is no superclass mapping for mapping
for "class domain.D".
     at
kodo.jdbc.meta.FlatClassMapping.assertParentMapping(FlatClassMapping.java:49)
     at kodo.jdbc.meta.FlatClassMapping.getTable(FlatClassMapping.java:85)
     at
kodo.jdbc.meta.OneToManyFieldMapping.fromMappingInfo(OneToManyFieldMapping.java:87)
     at
kodo.jdbc.meta.RuntimeMappingProvider.getFieldMapping(RuntimeMappingProvider.java:160)
     at
kodo.jdbc.meta.MappingRepository.getFieldMapping(MappingRepository.java:443)
     at
kodo.jdbc.meta.AbstractClassMapping.getFieldMapping(AbstractClassMapping.java:949)
4. If I run a simple test with the horizontal, flat and class-indicator
mappings, I get
kodo.jdbc.meta.MappingInfoNotFoundException: The "class-column"
attribute/extension for the class indicator on type
"domain.B.<class-indicator>" is missing or names a column that does not
exist.
     at kodo.jdbc.meta.Mappings.invalidMapping(Mappings.java:135)
     at kodo.jdbc.meta.Mappings.invalidMapping(Mappings.java:121)
     at
kodo.jdbc.meta.ColumnClassIndicator.fromMappingInfo(ColumnClassIndicator.java:95)
     at
kodo.jdbc.meta.RuntimeMappingProvider.initialize(RuntimeMappingProvider.java:135)
     at
kodo.jdbc.meta.MappingRepository.getMappingInternal(MappingRepository.java:378)
What am I doing wrong?
Thanks in advance
Srini

I solved this problem by removing the identifier field from the
class/mapping (kodo support).
Thanks
Srini
Stephen Kim wrote:
Do you have two fields mapped to the same column? Did you make sure you
set everything which maps to the column?
Srinivasan Ranganathan wrote:
I found what was wrong with this, fixed it and got a different (more
sensible) error. To correct this mapping, I specified B's mapping type as
"base" and gave its table and pk names. Also, I moved the common field
mappings to B.mapping so C.mapping and D.mapping only have fields that are
specific to each.
Now when I run a simple test, I get
testC:
kodo.util.FatalUserException: Attempt to set column "B.FOO" to two
different values: (java.lang.Object)"java.lang.Object@2f608ac2",
(java.lang.String)"fred" This can occur when you fail to set both sides of
a two-sided relation between objects, or when you map different fields to
the same column, but you do not keep the values of these fields in synch.
     at kodo.jdbc.runtime.VRow.setObjectInternal(VRow.java(Compiled Code))
     at kodo.jdbc.sql.AbstractRow.setObject(AbstractRow.java(Compiled Code))
     at
kodo.jdbc.meta.ColumnClassIndicator.insert(ColumnClassIndicator.java:143)
     at kodo.jdbc.runtime.UpdateManagerImpl.insert(UpdateManagerImpl.java:216)
     at kodo.jdbc.runtime.UpdateManagerImpl.insert(UpdateManagerImpl.java:219)
     at kodo.jdbc.runtime.UpdateManagerImpl.flush(UpdateManagerImpl.java:108)
     at kodo.jdbc.runtime.UpdateManagerImpl.flush(UpdateManagerImpl.java:73)
testD:
kodo.util.FatalUserException: Attempt to set column "B.FOO" to two
different values: (java.lang.Object)"java.lang.Object@2f608ac2",
(java.lang.String)"wilma" This can occur when you fail to set both sides
of a two-sided relation between objects, or when you map different fields
to the same column, but you do not keep the values of these fields in
synch.
     at kodo.jdbc.runtime.VRow.setObjectInternal(VRow.java(Compiled Code))
     at kodo.jdbc.sql.AbstractRow.setObject(AbstractRow.java(Compiled Code))
     at
kodo.jdbc.meta.ColumnClassIndicator.insert(ColumnClassIndicator.java:143)
     at kodo.jdbc.runtime.UpdateManagerImpl.insert(UpdateManagerImpl.java:216)
     at kodo.jdbc.runtime.UpdateManagerImpl.insert(UpdateManagerImpl.java:219)
     at kodo.jdbc.runtime.UpdateManagerImpl.flush(UpdateManagerImpl.java:108)
     at kodo.jdbc.runtime.UpdateManagerImpl.flush(UpdateManagerImpl.java:73)
I've checked for the two possible errors to the best of my knowledge. Any
input to resolve this issue is appreciated.
Thanks in advance
Srini
Srinivasan Ranganathan wrote:
Hi
I have an abstract class B which itself extends another abstract class A.
There is no table for A. The fields in A are mapped to B. I believe this
is called "horizontal mapping"
C and D inherit off B. There's a also a table named B (mapped to class B),
but none for C or D. Instances of C and D are recorded in table B. I
believe this is called "flat mapping"
B has a field foo whose possible values are 'fred' and 'wilma'.
If foo='fred', then the record is of type C
If foo='wilma', then the record is of type D
I believe this is called "class indicator" of type metadata.
To express this, I have package.jdo which says
<class name="A"/>
<class name="B" persistence-capable-superclass="A"/>
<class name="C" persistence-capable-superclass="B"/>
<class name="D" persistence-capable-superclass="B"/>
In B.mapping, I have
<mapping>
<package name="domain">
<class name="B">
<jdbc-class-map type="horizontal"/>
<jdbc-class-ind type="metadata-value" column="foo"/>
</class>
</package>
</mapping>
B.java has a private String foo.
In C.mapping, I have
<mapping>
<package name="domain">
<class name="C">
<jdbc-class-map type="flat"/>
<jdbc-class-ind-value value="fred"/>
field mappings for C
</class>
</package>
</mapping>
and similarly in D for value='wilma'
My questions are...
1. Is this kind of mapping supported by kodo?
2. If so, is this configuration correct? I guess not, since I don't
specify the table name anywhere. Where should it go?
3. If I remove the "class indicator" mapping and run a simple test I get
kodo.util.FatalUserException: There is no superclass mapping for mapping
for "class domain.D".
     at
kodo.jdbc.meta.FlatClassMapping.assertParentMapping(FlatClassMapping.java:49)
     at kodo.jdbc.meta.FlatClassMapping.getTable(FlatClassMapping.java:85)
     at
kodo.jdbc.meta.OneToManyFieldMapping.fromMappingInfo(OneToManyFieldMapping.java:87)
>>
     at
kodo.jdbc.meta.RuntimeMappingProvider.getFieldMapping(RuntimeMappingProvider.java:160)
>>
     at
kodo.jdbc.meta.MappingRepository.getFieldMapping(MappingRepository.java:443)
     at
kodo.jdbc.meta.AbstractClassMapping.getFieldMapping(AbstractClassMapping.java:949)
>>
>>
>>
>>
4. If I run a simple test with the horizontal, flat and class-indicator
mappings, I get
kodo.jdbc.meta.MappingInfoNotFoundException: The "class-column"
attribute/extension for the class indicator on type
"domain.B.<class-indicator>" is missing or names a column that does not
exist.
     at kodo.jdbc.meta.Mappings.invalidMapping(Mappings.java:135)
     at kodo.jdbc.meta.Mappings.invalidMapping(Mappings.java:121)
     at
kodo.jdbc.meta.ColumnClassIndicator.fromMappingInfo(ColumnClassIndicator.java:95)
>>
     at
kodo.jdbc.meta.RuntimeMappingProvider.initialize(RuntimeMappingProvider.java:135)
>>
     at
kodo.jdbc.meta.MappingRepository.getMappingInternal(MappingRepository.java:378)
>>
>>
>>
What am I doing wrong?
Thanks in advance
Srini
Steve Kim
[email protected]
SolarMetric Inc.
http://www.solarmetric.com

Similar Messages

  • Hello, i would like to know how to make horizontal sites and it moves with the scroll

    Hello, i would like to know how to make horizontal sites and it moves with the scroll

    Hi
    You can refer to these videos :
    http://www.lynda.com/Muse-tutorials/basics-horizontal-scrolling-websites/108131/115685-4.h tml
    https://www.youtube.com/watch?v=gZI_K1TXqOM
    Thanks,
    Sanjit

  • Horizontal mapping with inverse-owner doesn't work

    Hi,
    We encountered a problem of using inverse-owner with horizontal mapping.
    Here is the example.
    public abstract class A {
    //collection of class T
    private Set ts = new HashSet()
    public class B extends A {
    private String name;
    public class T {
    private A owner;
    private String text;
    we use metadata factory. package.jdo looks like this.
    <class name="T"/>
    <class name="A">
    <extension vendor-name="kodo" key="jdbc-class-map" value="horizontal"/>
    <field name="ts">
    <collection element-type="T"/>
    <extension vendor-name="kodo" key="inverse-owner"
    value="owner"/>
    </field>
    </class>
    <class name="B" persistence-capable-superclass="A">
    </class>
    mappingtool gives java.lang.ClassCastException
    at kodo.jdbc.meta.OneToManyFieldMapping.map(OneToManyFieldMapping.java:126)

    Fred-
    This is a bug in the automatic generation of mappings. See:
    http://bugzilla.solarmetric.com/show_bug.cgi?id=1096
    Note this this bug only seems to apply to the automatic generation of
    mappings: if you manually compose the .mapping file, then you can
    express the one-many mapping (provided you can cast it down to a single
    concrete type with the "type" extension).
    See the bug report page for an example mapping file solution.
    In article <[email protected]>, Fred Chen wrote:
    Hi,
    When using horizontal mappings, you cannot have an inverse type relation
    to a horizontally mapped class (there is no table to hold the
    inverse!)But that is precisely why we want to use the inverse mapping (to AVOID the
    unecessary middle table). Can you explain in a bit more detail why this is
    not supported?
    Thanks,
    Fred
    "Stephen Kim" <[email protected]> wrote in message
    news:[email protected]...
    When using horizontal mappings, you cannot have an inverse type relation
    to a horizontally mapped class (there is no table to hold the
    inverse!). However, if you have a concrete type that it is always
    mapped to, you can indicate that using the type and element-type
    extensions to override the Java declarations to the concrete mapped type.
    Fred Chen wrote:
    Hi,
    We encountered a problem of using inverse-owner with horizontal mapping.
    Here is the example.
    public abstract class A {
    //collection of class T
    private Set ts = new HashSet()
    public class B extends A {
    private String name;
    public class T {
    private A owner;
    private String text;
    we use metadata factory. package.jdo looks like this.
    <class name="T"/>
    <class name="A">
    <extension vendor-name="kodo" key="jdbc-class-map" value="horizontal"/>
    <field name="ts">
    <collection element-type="T"/>
    <extension vendor-name="kodo" key="inverse-owner"
    value="owner"/>
    </field>
    </class>
    <class name="B" persistence-capable-superclass="A">
    </class>
    mappingtool gives java.lang.ClassCastException
    at
    kodo.jdbc.meta.OneToManyFieldMapping.map(OneToManyFieldMapping.java:126)
    Steve Kim
    [email protected]
    SolarMetric Inc.
    http://www.solarmetric.com
    Marc Prud'hommeaux
    SolarMetric Inc.

  • OLAP on 11g and Materialised Views with Multiple Value-Based Hierarchies

    Hello OLAPians
    I am trying to setup Orable BIEE to report on an OLAP cube with pre-aggregated data. As OBIEE is not able to hook into the OLAP directly i have to create an SQL cubeview.
    Currently i am on a 10g OLAP environment and am using the oracle sample SQL cubeview generator to create an SQLview of my cube.
    The cube itself has multiple dimensions and these dimensions have multiple VALUE-based (ragged) hierarchies and dimension members can be shared across hierarchies also.
    Initially i had a problem running the view generator plugin because there is a bug within it that does not finish if there are multiple value-based hierarchies present. I was able to get around this by manually editing the limitmap for the cubeview and manually creating the SQL view.
    The question that i want to ask is how robust is the 11g materialised views with multiple value-based hierarchies and the sharing of dimension members across different hierarchies?
    Has anyone successfully been able to create a cubeview and import it into OBIEE without the hassle of manually editing the limitmap?
    A problem arises with the value-based setup whereby if the client creates a newer depth in the ragged hierarchy, i need to manually create the limitmap and the cube-view over again, and then re-map the BI Administration mappings.

    The simple answer to your question,
    how robust is the 11g materialised views with multiple value-based hierarchies...?is that materialized views are not supported on top of value-based hierarchies in 11g. The reason is that it is not possible to write a reasonable SQL statement that aggregates a fact over a value-based hierarchy. Such a SQL statement is necessary if we want to create a rewritable MV on top of the cube.
    But I suspect this is not what you are really asking. If you are trying to set up OBIEE on top of the cube in 10g using the view generator, then you will probably want to use the "ET VIEWS" that are generated automatically in 11g. These are generated whether or not you enable materialized views on top of your cube. I am not aware of any issues with the generated value-based hierarchy view support in 11g. Members may be shared between value hierarchies and you will not need to generate or modify limit maps.

  • How to find the column name and table name with a value

    Hi All
    How to find the column name and table name with "Value".
    For Example i have value named "Srikkanth" This value will be stored in one table and in one column i we dont know the table how to find the table name and column name
    Any help is highly appricatable
    Thanks & Regards
    Srikkanth.M

    2 solutions by Michaels (the latter is 11g upwards only)...
    michaels>  var val varchar2(5)
    michaels>  exec :val := 'as'
    PL/SQL procedure successfully completed.
    michaels>  select distinct substr (:val, 1, 11) "Searchword",
                    substr (table_name, 1, 14) "Table",
                    substr (t.column_value.getstringval (), 1, 50) "Column/Value"
               from cols,
                    table
                       (xmlsequence
                           (dbms_xmlgen.getxmltype ('select ' || column_name
                                                    || ' from ' || table_name
                                                    || ' where upper('
                                                    || column_name
                                                    || ') like upper(''%' || :val
                                                    || '%'')'
                                                   ).extract ('ROWSET/ROW/*')
                       ) t
    --        where table_name in ('EMPLOYEES', 'JOB_HISTORY', 'DEPARTMENTS')
           order by "Table"or
    SQL> select table_name,
           column_name,
           :search_string search_string,
           result
      from cols,
           xmltable(('ora:view("'||table_name||'")/ROW/'||column_name||'[ora:contains(text(),"%'|| :search_string || '%") > 0]')
           columns result varchar2(10) path '.'
    where table_name in ('EMP', 'DEPT')
    TABLE_NAME           COLUMN_NAME          SEARCH_STRING        RESULT   
    DEPT                 DNAME                ES                   RESEARCH 
    DEPT                 DNAME                ES                   SALES    
    EMP                  ENAME                ES                   JONES    
    EMP                  ENAME                ES                   JAMES    
    EMP                  JOB                  ES                   SALESMAN 
    EMP                  JOB                  ES                   SALESMAN 
    EMP                  JOB                  ES                   SALESMAN 
    EMP                  JOB                  ES                   PRESIDENT
    EMP                  JOB                  ES                   SALESMAN 
    9 rows selected.

  • Problem in mapping with multiple values

    Hi all,
    I am facing a problem during mapping. I am explainning the problem with a example.
    Suppose i have a source table named Employee which has two columns emp no and account no. I have a target table Emp_account which has also the same columns.
    One employee may have more than one accounts. In source table this account nos are stored in account no column in one row corresponding to emp no. The multiple values in account no are separated by comma for one record in source table.
    But in the target table Emp_account a single record will be inserted for each employee's separate account. There should not be multiple values separated by comma in account no column of target table.
    So if any employee has two accounts this will be stored as one row in source table but in target table it will divided into two different rows for each account.
    EMPLOYEE(Source)
    emp no account no
    10 101, 102
    EMP_ACCOUNT(Target)
    emp no account no
    10 101
    10 102
    Think I explained the requirement.. How can i made this in OWB mapping editor..Is it possible?...Can any operator perform this task...If any of u know about this plzz give some solution..It's very important ..
    Thanks & Regards,
    Sumanta Das

    Hi,
    With reference to your question.
    Can any operator perform this task..I don't think any single operator will help you.
    I suggest using an intermediate (staging) table by using a PL SQL procedure with output port to store the values of account number provided the number of accounts are limited. Else use an array variable for account of an employee.
    In short no simple solution because of the bad source design else the pivot/unpivot operator would have helped you.
    Cheers
    - Mohammed

  • Report Builder 3.0 and Report Parameters with Available Values - do a LIKE expression?

    I would like to write an expression based on a @Status parameter that includes the labels you see in the diagram.  My problem is that in the field Status - that includes these data results of Issued, Cancelled and Finaled - data entry is not consistent
    so I would like to do a like expression for the value - something like this Issued would be "Is*" or Cancelled would be "can*" etc. however I keep getting error statements and I'm not sure what I'm doing wrong. 

    Hi KittyCat101,
    If I understand correctly, you want to use a parameter to filter Status field that starts with “Is” or “Can” or “Fi”. If in this scenario, we can refer to the following steps to achieve your goal:
    Modify the available values for @Status parameter to “Is”, “Can” and “Fi”.
    Right-click the tablix or dataset to open the properties dialog box.
    Select Filter in the left pane, then add a filter like below to filter Status field:
    Expression: =Fields!Status.Value like (Parameters!Status.Value & "*")  Type: Boolean
    Operator: =
    Value: true
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Creating a Two Dimensional Array in Xcode and populating it with a values f

    Whats the easiest way to declare a two dimensional array in Xcode. I am reading an matrix of numbers from a text file from a website and want to take the data and place it into a 3x3 matrix.
    Once I read the URL into a string, I create an NSArray and use the componentsSeparatedByString method to strip of the carriage return line feed and create each individual row. I then get the count of the number of lines in the new array to get the individual values at each row. This will give mw an array with a string of characters, not a row of three individual values. I just need to be able to take these values and create a two dimensional array.

    I'm afraid you are in the wrong place. Look here for the last two forums on programming. However, XCode support is mostly found at developer.apple.com. You can access their forums by registering. Registration is free.

  • Adding and /exporting/ image with Metadata problem

    i have been able to add metadata to an image i need to publish but for some reason i am having a problem figuring out how to export this metada with the image.
    i see i have an option to export as original or as version. does this affect whether metada has been exported?
    also, can i export as PNG as get the metadata in the image or do i have to use something like jpg for some reason?
    finally, is there a way to verify that the metadata has been exported along with the image to my desktop before i upload to the web?! it seems really sort of odd to have to re-import the image into Aperture to test the exported image to see if the metadata is there. i mean, i am glad i just did this with the image and metadata that i exported b/c the metadata is not there but it seems like this could be simpler.
    TIA

    What export preset are you using? Did you check the box to include metadata. This is all in the manual. PNG has poor support for metadata so you're best sticking to Jpeg. You can check for the metadata in Preview, or an of a 100 other photo apps.
    Regards
    TD

  • How do i test split by value functionality in mesage mapping with multiple

    how do i test split by value functionality in mesage mapping with multiple values ?
    regards,
    venkat

    repeat your source node. in mapping editor you can view queues by right clicking to mapped element.. selecting Display Queues option.. this will show u your values .
    You can also select this Display Queue option for splitByValue option
    for example
    source--->splitByValue>target
    Try viewing your queues to each this step... for splitByValue in display Queue you will see context inserted(grey colour) accodingly

  • Horizontal mapping not working in Kodo 4.1.2

    Hello,
    I am having troubles in trying to get the class mapping I want in Kodo 4.1.2.
    I want to go from Kodo 3.3 to Kodo 4.1, and still in the evaluation process. Basically, all I want is to have my package.jdo files to work in Kodo 4.1, with the minimum modifications, before moving to JPA.
    The mapping is defined is my package.jdo using the <extension vendor-name="kodo" key="jdbc-class-map" value="XXX"/> where XXX can be one of horizontal, base or flat (I dont use vertical in this applicaion). This element does not seem to be properly recognized by the new mapping tool, and all my classes are mapped in the same base table.
    After some digging in the docs and in the examples provided, I found this <inheritance strategy="XXX"/> element, that can be put in my package.jdo file. This is not clearly said in the docs (it seems this element is only mentionned in the new orm DTD), but is used in the sample/jdo/horizontal/package.jdo file.
    Then I modified my package.jdo files, with this new element, where XXX is one of subclass-table, new-table (with no <join/> nested element) or superclass-table. But the result is not the one expected : all the classes are mapped in the same table.
    I then gave a try at the example provided, compiled, enhanced and mapped the sample/jdo/horizontal classes provided with the distribution, since this example covers exactly what I want to do. It seems to me that this example does not work either.
    The package.jdo says :
    <jdo>
    <package name="samples.jdo.horizontal">
    <sequence name="sjvm" factory-class="sjvm" strategy="nontransactional"/>
    <class name="LastModified">
    <inheritance strategy="subclass-table"/>
    </class>
    The mapping file I get says :
    <mapping>
    <package name="samples.jdo.horizontal">
    <class name="LastModified">
    <jdbc-class-map type="base" pk-column="ID" table="LASTMODIFIED"/>
    <jdbc-version-ind type="version-number" column="VERSN"/>
    <jdbc-class-ind type="in-class-name" column="TYP"/>
    <field name="creationDate">
    <jdbc-field-map type="value" column="CREATIONDATE"/>
    </field>
    <field name="lastModificationDate">
    <jdbc-field-map type="value" column="LASTMODIFICATIONDATE"/>
    </field>
    </class>
    The enhancement is made using jdoc, the mapping file is generated using the following command line (the DB is empty) :
    mappingtool -a refresh -f mapping.xml samples.jdo.horizontal.LastModifiedI would expect an horizontal mapping, with a class element containing only a <jdbc-class-map type="horizontal"/> element, as it is the case if I use my Kodo 3.3 mapping tool.
    I tried the enhancement / mapping file generation process with two configuration of the kodo.properties file : the first one with kodo3 as the Mapping Factory and the second with jdo. The result is the same in both cases. I verified by setting the log level to TRACE for the Tool what the factory used. In fact in both case, it is the MappingFileDeprecatedJDOMappingFactory, which seems weird to me.
    Bytheway, setting the MappingFactory to jpa leads to the following IllegalArgumentException during enhancement :
    Exception in thread "main" org.apache.openjpa.lib.util.ParseException: Instantiation of plugin "MetaDataFactory" with value "jpa" caused an error "java.lang.IllegalArgumentException : java.lang.ClassNotFoundException: jpa". The alias or class name may have been misspelled, or the class may not have be available in the class path. Valid aliases for this plugin are: [jdo, kodo3]
    I'd be glad to get any hint if I'm wrong on anything, or any workaround / patch to get my case to work.
    Thank you in advance,
    Jose

    If the same exact app and code works with 4.0 with the same ForeignKeyDeleteAction setting, I suggest that you open a case with support.
    This property hasn't changed since 4.0
    http://e-docs.bea.com/kodo/docs41/full/html/ref_guide_mapping_defaults.html
    Laurent

  • How can I create a hashmap() with multiple values for the same key?

    I am trying to write an application that will us something like a Map() with multiple values but some have the same key. Is this possible?

    i had the same question. just create a List, add all the values u want to it, and then put the List into the map like u would a normal single value. e.g.
    List list = new ArrayList();
    list.add(value1);
    list.add(value2);
    map.put(key, list);
    i bet u r doing the same course as i am =)

  • Request failed with SID value not found

    Hi Gurus, I have this error message "No SID found for value '15.00' of charateristic 0CURKEY_TC" and similar message with "10.00" and "*0.0" value, when trying to activate data in standard DSO in BI7.0.
    This is a Dev system just setup for traning purposes so I do not have any Master data to load. I am only loading transactional data from DataSource 0PU_IS_PS_32
    I tried searching for the answer and did the following
    1) Transfer Global Settings from the source system (which solved other problems but not this one)
    2) In RSRV, I do not see any errors for this InfoObject
    3) I am not sure how I can update table T006 and or TCURC with these values?
    I also tried following the Note: 619987 and does not know how I can implement this function module "If you nevertheless receive this error message for the initial value, this means that there is an inconsistency in the SID table for the 0UNIT or 0CURRENCY characteristic. You can eliminate this inconsistency by calling the RSDMD_INITIAL_LINE_INSERT function module with I_CHABASNM = 0UNIT or 0CURRENCY"
    Is there any help that anybody can extend, it will be greatly appreciated.

    Dear,
    SID error comes during activation of ODS because the related MD is not available for assigning SIDs.
    So as a first step ensure that the related master data is loaded and Attribute change run has been triggered.
    Or Load the MD and Activate the MD (Modeling > InfoObject > Search the Infoobject > Right click > Activate Master Data)
    Once you perform this you can retrigger the activation. It should work fine.
    Else as a workaround you can blank out these particular values and activate.
    There is also one more workaround wherein you can create the Master data entries directly in BW itself. But both the above step should be done after consulting Business and considering data volume that needs to be edited/created.
    In most case once you perform the loading and activation of MD your activation should work fine when repeated.
    There are cases where it failed again with the same error. In that case try this also (ensure that PSA is there).
    Delete the request in red.
    Go to monitor
    Edit > Setting for further update > Packet should be processed in the background.
    Edit > Update Reversal > Read everything manually > Yes
    Background processing successfully scheduled
    Then you can see the Load running again.
    Once this is done perform activation again
    Hope it helps
    Regards
    Bala

  • How do i split a line in a csv file and populate a combobox and a textbox with the parts

    What I'm trying to do is split the line and fill a combobox and with the selecteditem and the textbox with the value of the combobox selecteditem which is the second part of the line split.
    Thanks in advance for the help or suggestions.

    Then you should create a class to represent the items in the ComboBox:
    Public Class MyItem
    Public Property PartA As String
    Public Property PartB As String
    End Class
    ...and add instances of this class to the ComboBox:
    Try
    Dim mydocpath1 As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
    Dim mylines() As String = File.ReadAllLines(mydocpath1 + "\TextFile1.txt")
    For Each line In mylines
    Dim parts() As String = line.Split(","c)
    Dim item As MyItem = New MyItem With {.PartA = parts(0), .PartB = parts(1)}
    cmb1.Items.Add(item)
    Next line
    cmb1.SelectedItem = cmb1.Items(1) 'select second item
    Catch ex As Exception
    MsgBox(ex.Message)
    End Try
    Then you set the DisplayMemberPath of the ComboBox to the name of one property and bind the Text property of the TextBlock to the other one:
    <ComboBox Name="cmb1" DisplayMemberPath="PartA" />
    <TextBlock Text="{Binding ElementName=cmb1, Path=SelectedItem.PartB}" />
    That should solve your issue.
    Once again, please remember to mark helpful posts as answer to close your threads and remember that a new thread deserves a new question.

  • Please Help::How to display a Map with LIsts as Keys and Values using JSTL

    Hi,
    I need some assistance on how to display a Map in JSP using struts or core JSTL. I have a HashMap which has a List of keys and each key maps to a value of an ArrayList.i.e I have an ArrayList of taxCodes and each taxCode maps to a value of taxDetails which is an ArrayList of details for for that particular taxCode. I have some trouble to display each taxCode then display taxDetails for each taxCode. Here is my code below:
    OrderDetails.java
    package orderitems;
    import java.sql.*;
    import java.util.*;
    public class OrderDetails {
        private LineOder lineOrder;
        private Map lineItems;
        //returns an item number, key_item, from its unique keys
        public int getItemNumber(int key_item, String key_year,
                String key_office,String key_client,String key_company){
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            int itmNum = 0;
             * key_item a unique number for an item.
             * key_year,key_office,key_client,key_company unique keys
             * for each order where this key_item is taken
             * from.
            String select = "SELECT key_item FROM "+
                    Constants.WEB_TABLE +" WHERE key_item = " + key_item +
                    " AND key_year = '" + key_year + "'" +
                    " AND key_office = '" + key_office + "'" +
                    " AND key_client = '" + key_client + "'" +
                    " AND key_company = '" + key_company +"'";
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                rst = stat.executeQuery(select);
                if(rst.next()){
                    itmNum = Integer.parseInt(rst.getString("key_item"));
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return itmNum;
        //get a list of item number(item codes)
        public List getAllItemNumbers(String key_year,
                String key_office,String key_client,String key_company){
            List itemNumbers = new ArrayList();
            LineItem itemNumber = null;
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            String select = "SELECT key_item FROM "+ Constants.WEB_TABLE +
                    " WHERE key_year = '" + key_year + "'" +
                    " AND key_office = '" + key_office + "'" +
                    " AND key_client = '" + key_client + "'" +
                    " AND key_company = '" + key_company + "'";
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                rst = stat.executeQuery(select);
                while(rst.next()){
                    itemNumber = new LineItem();
                    itemNumber.setKey_item(Integer.parseInt(rst.getString("key_item")));
                    itemNumbers.add(itemNumber);
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return itemNumbers;
        //get a list of tax codes
        public List getAllTaxCodes(int key_item, String key_year,
                String key_office,String key_client,String key_company){
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            ItemTax taxCode;
            List taxCodes = new ArrayList();
            int itemNum = getItemNumber(key_item, key_year,
                    key_office,key_client,key_company);
            String select = "SELECT key_tax_code FROM "+
                    Constants.WEB_TABLE +" WHERE key_item = " + itemNum +
                    " AND key_year = '" + key_year + "'" +
                    " AND key_office = '" + key_office + "'" +
                    " AND key_client = '" + key_client + "'" +
                    " AND key_company = '" + key_company +"'";
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                rst = stat.executeQuery(select);
                while(rst.next()){
                    taxCode = new ItemTax();
                    taxCode.setKey_tax_code(rst.getString("key_tax_code"));
                    taxCodes.add(taxCode);
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return taxCodes;
        /////This methode returns a Map which am trying to display in JSP
        //use tax code to get tax details
        public Map getItemTaxDetails(String key_year,String key_office,
                String key_client,String key_company,int key_item){
            ItemTax taxDetail = null;
            List taxDetails = new ArrayList();
            List itemTaxCodes = new ArrayList();
            Map itemTaxDetails = new HashMap();
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            //get a list of all tax codes of an item with a
            //given item number
            itemTaxCodes = getAllTaxCodes(key_item,key_year,
                    key_office,key_client,key_company);
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                for(Iterator taxCodeIter= itemTaxCodes.iterator(); taxCodeIter.hasNext();){
                    ItemTax itemTaxCode = (ItemTax)taxCodeIter.next();
                    String taxCode = itemTaxCode.getKey_tax_code();
                    String select = "SELECT tax_type,tax_value," +
                            "tax_limit_val FROM "+ Constants.WEB_TABLE +
                            " WHERE key_item = "+ key_item +
                            " AND key_year = '" + key_year + "'" +
                            " AND key_office = '" + key_office + "'" +
                            " AND key_client = '" + key_client + "'" +
                            " AND key_company = '" + key_company +"'" +
                            " AND key_tax_code = '" + taxCode + "'";
                    rst = stat.executeQuery(select);
                    while(rst.next()){
                        taxDetail = new ItemTax();
                        //records to be displayed only
                        taxDetail.setKey_item(Integer.parseInt(rst.getString("key_item")));
                        taxDetail.setTax_value(rst.getString("tax_value"));
                        taxDetail.setTax_limit_val(Float.parseFloat(rst.getString("tax_limit_val")));
                        //////other details records ommited//////////////////////////
                        taxDetails.add(taxDetail);////An ArrayList of taxDetails for each taxCode
                     * A HashMap which has all taxCodes of an item as its keys
                     * and an ArrayList of taxdetails as its values.
                     * I return this for display in a JSP.
                    itemTaxDetails.put(taxCode,taxDetails);
                System.out.println();
                System.out.println("*********CONSOLE OUTPUT*************");//display on console
                Set set = itemTaxDetails.keySet();
                Iterator iter = set.iterator();
                System.out.println("Key\t\tValue\r\n");
                while (iter.hasNext()) {
                    Object taxCode=iter.next();
                    Object details=itemTaxDetails.get(taxCode);
                    System.out.println(taxCode +"\t" + details);
                System.out.println("************************************");
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return itemTaxDetails;
        //details of an item with all its taxes
        public List getAllItemDetails(String key_year,
                String key_office,String key_client,String key_company){
            List lineItems = new ArrayList();
            List itemNumbers = new ArrayList();
            Map taxDetails = new HashMap();
            LineItem item = null;
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            //A list of all item numbers in the declaration
            itemNumbers = getAllItemNumbers(key_year,
                    key_office,key_client,key_company);
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                for(Iterator itemIter= itemNumbers.iterator(); itemIter.hasNext();){
                    LineItem itemNum = (LineItem)itemIter.next();
                    int itemNumber = itemNum.getKey_item();
                    String select = "SELECT item_description,item_mass," +
                            "item_cost" +
                            " FROM " + Constants.WEB_TABLE +
                            " WHERE key_year = '"+key_year+"'" +
                            " AND key_office = '"+key_office+ "'"+
                            " AND key_client = '"+key_client+ "'"+
                            " AND key_company = '"+key_company+ "'"+
                            " AND key_item = " + itemNumber;
                    rst = stat.executeQuery(select);
                    while(rst.next()){
                        item = new LineItem();
                        item.setItem_description(rst.getString("item_description"));
                        item.setItem_mass(Float.parseFloat(rst.getString("item_mass")));
                        item.setKey_item(Integer.parseInt(rst.getString("item_cost")));
                        //////other details records ommited//////////////////////////
                        /* A HashMap of all itemTaxeCodes as its keys and an
                         * ArrayList of itemTaxedetails as its values
                        taxDetails = getItemTaxDetails(item.getKey_year(),item.getKey_office(),
                                item.getKey_client(),item.getKey_company(),item.getKey_item());
                        //item tax details
                        item.setItmTaxes(taxDetails);
                        //list of items with tax details
                        lineItems.add(item);
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return lineItems;
        public Set getOrders(String key_year,String key_office,
                String key_client,String key_company){
            List lineItems = new ArrayList();
            Set lineOrders = new HashSet();
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            LineOder lineOrder = null;
            String select = "SELECT * FROM " + Constants.WEB_TABLE +
                    " WHERE key_year = '" + key_year + "'" +
                    " AND key_office = '" + key_office + "'" +
                    " AND key_client = '" + key_client + "'" +
                    " AND key_company = '" + key_company + "'";
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                rst = stat.executeQuery(select);
                while(rst.next()){
                    lineOrder = new LineOder();
                    lineOrder.setKey_year(rst.getString("key_year"));
                    lineOrder.setKey_office(rst.getString("key_office"));
                    lineOrder.setKey_client(rst.getString("key_client"));
                    lineOrder.setKey_company(rst.getString("key_company"));
                    ////list of items with all their details
                    lineItems = getAllItemDetails(lineOrder.getKey_year(),lineOrder.getKey_office(),
                            lineOrder.getKey_client(),lineOrder.getKey_company());
                    //setting item details
                    lineOrder.setItems(lineItems);
                    //a list of order with all details
                    lineOrders.add(lineOrder);
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            return lineOrders;
    Controller.java
    package orderitems;
    import java.io.*;
    import java.util.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class Controller extends HttpServlet {
        private Map taxDetails = new HashMap();
        private OrderDetails orderDetails = null;
        protected void processRequest(HttpServletRequest request,
                HttpServletResponse response)throws
                ServletException, IOException {
            response.setContentType("text/html;charset=UTF-8");
            String key_year = "2007";
            String key_office = "VZX00";
            String key_company = "DG20";
            String key_client =  "ZI001";
            int key_item = 1;
            String nextView = "/taxdetails_list.jsp";
            orderDetails = new OrderDetails();
            taxDetails = orderDetails.getItemTaxDetails(key_year,key_office,
                    key_company,key_client,key_item);
            //Store the collection objects into HTTP Request
            request.setAttribute("taxDetails", taxDetails);
            RequestDispatcher reqstDisp =
                    getServletContext().getRequestDispatcher(nextView);
            reqstDisp.forward(request,response);
        protected void doGet(HttpServletRequest request,
                HttpServletResponse response)throws
                ServletException, IOException {
            processRequest(request, response);
        protected void doPost(HttpServletRequest request,
                HttpServletResponse response)throws
                ServletException, IOException {
            processRequest(request, response);
    taxdetails_list.jsp
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <title>Simple Tax Detail Diaplay ::</title>
            <link rel="stylesheet" type="text/css" href="imgs/orders.css"/>
        </head>
        <body>
            <jsp:useBean id="taxDetails" class="java.util.HashMap" scope="request"/>
            <table>
                <c:forEach items="${taxDetails}" var="hMap">
                    <tr>
                        <td><c:out value="${hMap.key}" /></td>
                        <!--td><%--c:out value="${hMap.value}" /--%></td-->
                    </tr>
                </c:forEach>
            </table>
        </body>
    </html>am displaying taxCodes(in this case i have VAT and ICD) fine but cant figure out how to display a list of value for each taxCode.Here is the output am getting
    both in my JSP and on the console:
    *******************************CONSOLE OUTPUT****************************
    Key          Value
    ICD     [orderItems.ItemTax@13e6226, orderItems.ItemTax@9dca26]
    VAT [orderItems.ItemTax@13e6226, orderItems.ItemTax@9dca26]
    Edited by: aiEx on Oct 8, 2007 6:54 AM

    hi evnafets,
    yes i need a nested for loop.I have tried your advice but my bean properties are not found.Am getting this error:
    javax.servlet.ServletException: Unable to find a value for "key_item" in object of class "java.lang.String" using operator "."
    I have tried this as stated earlier in the post:I have tried to make the method getItemTaxDetails return a List and get the returned list value as taxDetails. I then tested to display this list on JSP and its displaying fine.
    public List getItemTaxDetails(String key_year,String key_office,
                String key_client,String key_company,int key_item){
            ItemTax taxDetail = null;
            List taxDetails = new ArrayList();
            List itemTaxCodes = new ArrayList();
            Map itemTaxDetails = new HashMap();
            Connection conn = null;
            Statement stat = null;
            ResultSet rst = null;
            //get a list of all tax codes of an item with a
            //given item number
            itemTaxCodes = getAllTaxCodes(key_item,key_year,
                    key_office,key_client,key_company);
            DbConnection dbConn = new DbConnection();
            try {
                conn = dbConn.getDbConnection(Constants.WEB_JNDI);
                stat = conn.createStatement();
                for(Iterator taxCodeIter= itemTaxCodes.iterator(); taxCodeIter.hasNext();){
                    ItemTax itemTaxCode = (ItemTax)taxCodeIter.next();
                    String taxCode = itemTaxCode.getKey_tax_code();
                    String select = "SELECT tax_type,tax_value," +
                            "tax_limit_val FROM "+ Constants.WEB_TABLE +
                            " WHERE key_item = "+ key_item +
                            " AND key_year = '" + key_year + "'" +
                            " AND key_office = '" + key_office + "'" +
                            " AND key_client = '" + key_client + "'" +
                            " AND key_company = '" + key_company +"'" +
                            " AND key_tax_code = '" + taxCode + "'";
                    rst = stat.executeQuery(select);
                    while(rst.next()){
                        taxDetail = new ItemTax();
                        //records to be displayed only
                        taxDetail.setKey_item(Integer.parseInt(rst.getString("key_item")));
                        taxDetail.setTax_value(rst.getString("tax_value"));
                        taxDetail.setTax_limit_val(Float.parseFloat(rst.getString("tax_limit_val")));
                        //////other details records ommited//////////////////////////
                        taxDetails.add(taxDetail);////An ArrayList of taxDetails for each taxCode
                     * A HashMap which has all taxCodes of an item as its keys
                     * and an ArrayList of taxdetails as its values.
                     * I return this for display in a JSP.
                    itemTaxDetails.put(taxCode,taxDetails);
            } catch (SQLException ex) {
                ex.printStackTrace();
            } finally{
                SQLHelper.cleanUp(rst, stat, conn);
            //return itemTaxDetails;
            return taxDetails;
        }And my JSP
    taxdetails_list.jsp
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
            <link rel="stylesheet" type="text/css" href="imgs/orders.css"/>
        </head>
        <body>
            <table>
                <c:forEach var="curRecord" items="${taxDetails}" varStatus="rowCounter">
                        <c:choose>
                            <c:when test="${rowCounter.count % 2 == 0}">
                                <c:set var="rowStyle" scope="page" value="odd" />
                            </c:when>
                            <c:otherwise>
                                <c:set var="rowStyle" scope="page" value="even" />
                            </c:otherwise>
                        </c:choose>
                        <tr class="${rowStyle}">
                            <td>${curRecord.key_item}</td>
                            <td>${curRecord.tax_value}</td>
                            <td>${curRecord.tax_limit_val}</td>
                        </tr>
                    </c:forEach>
            </table>
        </body>
    </html>I can't see where am going wrong even with your advice.Please help.
    Thnx.

Maybe you are looking for