Horizontal mapping base class query

Greetings,
I have a class hierarchy which looks like the following:
abstract class A {
int num;
class B extends A
class C extends A
class D extends A
This hierarchy is horizontally mapped. Say I want to run the following query. Give me the 10 objects of type A (either B,C or D practically) with the highest num. I would run the following query:
Query query = pm.newQuery("select from A.class range 0, 10");
query.setOrdering("num descending");
I would expect this query to return a maximum of 10 results. It in fact returns up to 30 results, i.e. 10 per subclass type. What is wrong in the structure of the query or my classes? Is this expected behaviour and does anyone know how I may remedy this situation?
Thanks in advance,
Adam.

David-
Did I understand that correctly?You are correct.
If so, why does this limitation exist?It is because a proper relation cannot exist in the database if the
target table is unknown (which it is for horizontally mapped classes),
and joins would become tremendously complex or, in some cases, simply
impossible to accomplish with a single SQL statement.
We are considering adding some support for querying across horizontal
relations that are using non-composite primary keys, but it is currently
not possible.
In article <d3eig3$ssb$[email protected]>, David Ezzio wrote:
Hi guys,
Suppose that we have the following inheritance structure:
Class: LegalEntity
Field: LegalEntity relatedTo
Field: String name
Class: Person extends LegalEntity
Field: String ssn
Class: Corporation extends LegalEntity
Field: String location
Class: CollegeStudent extends Person
Field: String school
Class: Employee extends Person
Field: Corporation company
If a flat mapping is used throughout, then we end up with one table
(LEGALENTITY) with the columns: relatedTo, name, ssn, location, school,
and company, plus the Kodo created jdo columns.
If we wanted to create several tables, we could map LegalEntity and
Person horizontally, making the base tables COLLEGESTUDENT, EMPLOYEE,
and CORPORATION.
If I understand section 7.6.4.3 correctly, the value stored in the
relatedto column will be a stringified object identity, and Kodo does
does not support queries across this relation. Thus, the query find all
CollegeStudent objects that satisfies the filter "relatedTo.name ==
\"Sally\"" is not supported.
Did I understand that correctly?
If so, why does this limitation exist?
David
Marc Prud'hommeaux
SolarMetric Inc.

Similar Messages

  • Horizontal mapping and query limitation

    Hi guys,
    Suppose that we have the following inheritance structure:
    Class: LegalEntity
    Field: LegalEntity relatedTo
    Field: String name
    Class: Person extends LegalEntity
    Field: String ssn
    Class: Corporation extends LegalEntity
    Field: String location
    Class: CollegeStudent extends Person
    Field: String school
    Class: Employee extends Person
    Field: Corporation company
    If a flat mapping is used throughout, then we end up with one table
    (LEGALENTITY) with the columns: relatedTo, name, ssn, location, school,
    and company, plus the Kodo created jdo columns.
    If we wanted to create several tables, we could map LegalEntity and
    Person horizontally, making the base tables COLLEGESTUDENT, EMPLOYEE,
    and CORPORATION.
    If I understand section 7.6.4.3 correctly, the value stored in the
    relatedto column will be a stringified object identity, and Kodo does
    does not support queries across this relation. Thus, the query find all
    CollegeStudent objects that satisfies the filter "relatedTo.name ==
    \"Sally\"" is not supported.
    Did I understand that correctly?
    If so, why does this limitation exist?
    David

    David-
    Did I understand that correctly?You are correct.
    If so, why does this limitation exist?It is because a proper relation cannot exist in the database if the
    target table is unknown (which it is for horizontally mapped classes),
    and joins would become tremendously complex or, in some cases, simply
    impossible to accomplish with a single SQL statement.
    We are considering adding some support for querying across horizontal
    relations that are using non-composite primary keys, but it is currently
    not possible.
    In article <d3eig3$ssb$[email protected]>, David Ezzio wrote:
    Hi guys,
    Suppose that we have the following inheritance structure:
    Class: LegalEntity
    Field: LegalEntity relatedTo
    Field: String name
    Class: Person extends LegalEntity
    Field: String ssn
    Class: Corporation extends LegalEntity
    Field: String location
    Class: CollegeStudent extends Person
    Field: String school
    Class: Employee extends Person
    Field: Corporation company
    If a flat mapping is used throughout, then we end up with one table
    (LEGALENTITY) with the columns: relatedTo, name, ssn, location, school,
    and company, plus the Kodo created jdo columns.
    If we wanted to create several tables, we could map LegalEntity and
    Person horizontally, making the base tables COLLEGESTUDENT, EMPLOYEE,
    and CORPORATION.
    If I understand section 7.6.4.3 correctly, the value stored in the
    relatedto column will be a stringified object identity, and Kodo does
    does not support queries across this relation. Thus, the query find all
    CollegeStudent objects that satisfies the filter "relatedTo.name ==
    \"Sally\"" is not supported.
    Did I understand that correctly?
    If so, why does this limitation exist?
    David
    Marc Prud'hommeaux
    SolarMetric Inc.

  • 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

  • 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

  • Horizontal mapping + embedded one-to-one problem

    Hi,
    this message corresponds to the article "Embedded One-to-One mapping
    problem". But this article is more exactly then the first without less
    unnessary information.
    I got an abstract super-class Person which is mapped horizontal.
    Student inherits from Person.
    Person contains an attribute called location(instance of Class Location)
    which should be mapped "embedded one-to-one".
    Since Person is mapped horizontal no table will be used for Person.
    I get following exception when running mappingtool on action "buildSchema"
    kodo.jdbc.meta.MappingInfoNotFoundException: No mapping information was
    found for "xxx.yyy.zzz.persistence.jdo.business.Location.lat"
    I think Kodo tries to map the field "location" since the field is declared
    as embedded. But it can not embed the field since Person is horizontal
    mapped and no table for Person exists where the corresponding field of
    Location could be placed in. Also it is not possible to set the "embedded"
    attribute in the subclass Student for the field "location" because it must
    be specified in the superclass.
    Can you help me ?
    Thanks a lot,
    Felix
    Additional information:
    =======================
    Exception stack trace:
    [mappingtool] kodo.jdbc.meta.MappingInfoNotFoundException: No mapping
    information was found for "xxx.yyy.zzz.persistence.jdo.business.Location".
    [mappingtool] at
    kodo.jdbc.meta.RuntimeMappingProvider.getMapping(RuntimeMappingProvider.java:44)
    [mappingtool] at
    kodo.jdbc.meta.MappingRepository.getMappingInternal(MappingRepository.java:352)
    [mappingtool] at
    kodo.jdbc.meta.MappingRepository.getMapping(MappingRepository.java:307)
    [mappingtool] at
    kodo.jdbc.meta.MappingRepository.getMapping(MappingRepository.java:162)
    [mappingtool] at
    kodo.jdbc.meta.MappingTool.buildSchema(MappingTool.java:646)
    [mappingtool] at kodo.jdbc.meta.MappingTool.run(MappingTool.java:951)
    [mappingtool] at
    kodo.jdbc.ant.MappingToolTask.executeOn(MappingToolTask.java:175)
    [mappingtool] at com.solarmetric.ant.TaskBase.execute(TaskBase.java:105)
    [mappingtool] at
    org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:269)
    [mappingtool] at org.apache.tools.ant.Task.perform(Task.java:364)
    [mappingtool] at org.apache.tools.ant.Target.execute(Target.java:301)
    [mappingtool] at
    org.apache.tools.ant.Target.performTasks(Target.java:328)
    [mappingtool] at
    org.apache.tools.ant.Project.executeTarget(Project.java:1215)
    [mappingtool] at
    org.apache.tools.ant.Project.executeTargets(Project.java:1063)
    [mappingtool] at org.apache.tools.ant.Main.runBuild(Main.java:632)
    [mappingtool] at org.apache.tools.ant.Main.startAnt(Main.java:183)
    [mappingtool] at
    org.apache.tools.ant.launch.Launcher.run(Launcher.java:197)
    [mappingtool] at
    org.apache.tools.ant.launch.Launcher.main(Launcher.java:56)
    Here is the JDO-Metadata:
    <?xml version="1.0" encoding="UTF-8"?>
    <jdo>
    <package name="xxx.yyy.zzz.persistence.jdo.business">
    <class name="Location"/>
    <class name="Person" identity-type="application"
    objectid-class="PersonId">
    <field name="location" embedded="true"/>
    <field name="id" primary-key="true"/>
    </class>
    <class name="Student" identity-type="application"
    persistence-capable-superclass="Person"/>
    </package>
    </jdo>
    Here is the mapping-metadata:
    <?xml version="1.0" encoding="UTF-8"?>
    <mapping>
    <package name="xxx.yyy.zzz.persistence.jdo.business">
    <class name="Person">
    <jdbc-class-map type="horizontal"/>
    </class>
    <class name="Student">
    <jdbc-class-map type="base" table="STUDENT"/>
    <jdbc-version-ind type="version-number" column="JDOVERSION"/>
    <jdbc-class-ind type="in-class-name" column="JDOCLASS"/>
    <field name="Person.birthDate">
    <jdbc-field-map type="value" column="BIRTHDATE"/>
    </field>
    <field name="Person.city">
    <jdbc-field-map type="value" column="CITY"/>
    </field>
    <field name="Person.id">
    <jdbc-field-map type="value" column="ID"/>
    </field>
    <field name="Person.location">
    <jdbc-field-map type="embedded"
    null-ind-column="NULL_INDICATOR" synthetic="false">
    <field name="lat">
    <jdbc-field-map type="value" column="LATITUDE"/>
    </field>
    <field name="lon">
    <jdbc-field-map type="value" column="LONGITUDE"/>
    </field>
    </jdbc-field-map>
    </field>
    <field name="Person.name">
    <jdbc-field-map type="value" column="NAME"/>
    </field>
    <field name="Person.picture">
    <jdbc-field-map type="value" column="PICTURE"/>
    </field>
    <field name="Person.state">
    <jdbc-field-map type="value" column="STATE"/>
    </field>
    <field name="Person.street">
    <jdbc-field-map type="value" column="STREET"/>
    </field>
    <field name="Person.zipcode">
    <jdbc-field-map type="value" column="ZIPCODE"/>
    </field>
    </class>
    <class name="Location">
    <jdbc-class-map type="none"/>
    <field name="lat">
    <jdbc-field-map type="none"/>
    </field>
    <jdbc-class-map type="none"/>
    <field name="lon">
    <jdbc-field-map type="none"/>
    </field>
    </class>
    </package>
    </mapping>
    Here are the class definitions:
    Class Location:
    public class Location {
         private int lat;
         private int lon;
    Class Person:
    public abstract class Person {
    private int id;
    private String name;
    private String street;
    private String city;
    private String state;
    private String zipcode;
    private Date birthDate;
    private String picture;
    private Location location;
    Class Person:
    public class Student extends Person {

    You'll probably have much better luck sending this question to
    [email protected]; the newsgroup is generally for quick questions
    about certain features or problems the community might be able to solve
    without input from SolarMetric developers.

  • Horizontal mapping question

    Hello,
    I have and Person, Post and Organization extending Party class. I map
    Person, Post and Organization class each on its own table
    Now Person and Organization have a bi-directional association with each
    other (via inverted relation) - Organization has a collection of Persons
    and Person references back to Organization
    I would like to know how Kodo will fetch persons for a given organization.
    Will Kodo optimize SQL to not to attempts to query all tables of
    implementations of Party when fetching relation expressed on specific
    subclasses - Organization and Person in this case
    Could you please post some details on horizontal mapping rules and what
    cases are the most expansive in terms of SQL and performance and if there
    are any limitations as far as eager fetching is concerned
    Thank you
    Alex

    Alex,
    Things only get complex if you have relations to the virtual class --
    Party, in this case.
    If you declare a field to be a relation to a subclass, Kodo won't
    attempt to look in the other subclass tables.
    If you query on Party, Kodo will issue three queries -- one for Person,
    one for Post, and one for Organization. This is analgous to Kodo's
    support for queries on interfaces.
    Declaring a relation to Party will be the most expensive, as Kodo will
    not be able to do the join on the database side, but will have to bring
    the OID(s) into the JVM and then do the lookup from there.
    -Patrick
    Alex Roytman wrote:
    Hello,
    I have and Person, Post and Organization extending Party class. I map
    Person, Post and Organization class each on its own table
    Now Person and Organization have a bi-directional association with each
    other (via inverted relation) - Organization has a collection of Persons
    and Person references back to Organization
    I would like to know how Kodo will fetch persons for a given organization.
    Will Kodo optimize SQL to not to attempts to query all tables of
    implementations of Party when fetching relation expressed on specific
    subclasses - Organization and Person in this case
    Could you please post some details on horizontal mapping rules and what
    cases are the most expansive in terms of SQL and performance and if there
    are any limitations as far as eager fetching is concerned
    Thank you
    Alex

  • How to call derived class to base class

    Hello everybody,
    I create a GUi application in java swing. Now i want to navigate between the screen but the timing between the screen is very slow bcoz i imported the class from package to another package. Now i want to extends one package to another package to reduce the navigation time but it saying error bcoz i cant able to call my derived class to base class. if anyone know the answer for this please answer this immediately.
    If any other method is there to optimise the navigation time please tell me
    by
    (kamal)

    Sorry, I've got major difficulties understanding your query:
    I create a GUi application in java
    ication in java swing. ok
    Now i want to navigate between
    the screenwhat? switch screens? display a different dialog?
    but the timing between the screen is very
    slowtiming? do you mean the time it takes to display a different dialog?
    bcoz i imported the class from package to
    another package.how did you come to the conclusion that that is the reason for the slowness? Did you do any profiling or is this just guess-work?

  • About Horizontal mapping !!!

    Hello,
    I want to use the horizontal mapping, I have read the documentation
    several times but no succes until now !!!
    I have managed to use the vertical one and it worked...
    I did add this line in yhe kodo property file:
    kodo.jdbc.SubclassMapping: vertical
    Then in order to use the horizontal mapping I tried to add this line:
    kodo.jdbc.SubclassMapping: horizontal ---> but it did not work.
    then I tried to do this in my package.jdo file:
    <class name="Customer" identity-type="datastore"
    persistence-capable-uperclass="Person">
    <extension vendor-name="kodo" key="jdbc-class-map" value="horizontal"/>
    </class>
    but no succes ...
    what I want is this:
    I have those classes
    class Person
    private String first_name;
    private String last_name
    class Customer extends Person
    private String city;
    private String country;
    I want a mapping that associate on table to a class as following:
    table person:
    first_name
    last_name
    table Customer:
    first_name
    last_name
    city
    country
    Can you tell what can I do please !!!
    I have red the doc but I can find it out ...
    thank a lot for your help
    smail

    hello,
    Are you sure ?
    because in your docs it is mentioned that you support it.
    go to this link :
    http://docs.solarmetric.com/manual.html#ref_guide_mapping_classmapping
    it is explained there !
    thanks,
    smail

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

  • Horizontal mapping + MappingInfoNotFoundException

    Hi,
    i got a problem with the mappingtool.
    I'am using horizontal mapping.
    The abstract superclass Person has an primary key field called id.
    Here is the jdo-metadata from package.jdo:
    <class name="Person" identity-type="application"
    objectid-class="PersonId">
    <field name="location" embedded="true"/>
    <field name="id" primary-key="true"/>
    <field name="kidNames">
    <collection element-type="java.lang.String"/>
    </field>
    </class>
    Here is the mapping data from package.mapping:
    <class name="Person">
    <jdbc-class-map type="horizontal"/>
    </class>
    I looked at the manual, section 7.6.4.
    Thank you
    Zach
    688 INFO [main] kodo.Tool - Mapping tool running on type "class
    xxx.persistence.jdo.business.Course" with action "validate".
    kodo.jdbc.meta.MappingInfoNotFoundException: No mapping information was
    found fo
    r "xxx.business.Person.id".
    at
    kodo.jdbc.meta.RuntimeMappingProvider.getFieldMapping(RuntimeMappingP
    rovider.java:149)
    at
    kodo.jdbc.meta.MappingRepository.getFieldMapping(MappingRepository.ja
    va:429)
    at
    kodo.jdbc.meta.AbstractClassMapping.getFieldMapping(AbstractClassMapp
    ing.java:911)
    at
    kodo.jdbc.meta.AbstractClassMapping.getFieldMapping(AbstractClassMapp
    ing.java:888)
    at
    kodo.jdbc.meta.AbstractClassMapping.getFieldMapping(AbstractClassMapp
    ing.java:666)
    at
    kodo.jdbc.meta.RuntimeMappingProvider.initialize(RuntimeMappingProvid
    er.java:89)
    at
    kodo.jdbc.meta.MappingRepository.getMappingInternal(MappingRepository
    java:364)
    at
    kodo.jdbc.meta.MappingRepository.getMapping(MappingRepository.java:30
    7)
    at
    kodo.jdbc.meta.AbstractFieldMapping.getTypeMapping(AbstractFieldMappi
    ng.java:661)
    at
    kodo.jdbc.meta.OneToOneFieldMapping.fromMappingInfo(OneToOneFieldMapp
    ing.java:123)
    at
    kodo.jdbc.meta.RuntimeMappingProvider.getFieldMapping(RuntimeMappingP
    rovider.java:160)
    at
    kodo.jdbc.meta.MappingRepository.getFieldMapping(MappingRepository.ja
    va:429)
    at
    kodo.jdbc.meta.AbstractClassMapping.getFieldMapping(AbstractClassMapp
    ing.java:911)
    at
    kodo.jdbc.meta.AbstractClassMapping.getFieldMapping(AbstractClassMapp
    ing.java:891)
    at
    kodo.jdbc.meta.AbstractClassMapping.getMappings(AbstractClassMapping.
    java:854)
    at
    kodo.jdbc.meta.AbstractClassMapping.getDeclaredFieldMappings(AbstractClassMapping.java:617)
    at
    kodo.jdbc.meta.AbstractClassMapping.resolve(AbstractClassMapping.java
    :758)
    at
    kodo.jdbc.meta.BaseClassMapping.resolve(BaseClassMapping.java:323)
    at
    kodo.jdbc.meta.MappingRepository.resolve(MappingRepository.java:390)
    at
    kodo.jdbc.meta.MappingRepository.getMapping(MappingRepository.java:30
    8)
    at
    kodo.jdbc.meta.AbstractFieldMapping.getTypeMapping(AbstractFieldMappi
    ng.java:661)
    at
    kodo.jdbc.meta.OneToOneFieldMapping.fromMappingInfo(OneToOneFieldMapp
    ing.java:123)
    at
    kodo.jdbc.meta.RuntimeMappingProvider.getFieldMapping(RuntimeMappingP
    rovider.java:160)
    at
    kodo.jdbc.meta.MappingRepository.getFieldMapping(MappingRepository.ja
    va:429)
    at
    kodo.jdbc.meta.AbstractClassMapping.getFieldMapping(AbstractClassMapp
    ing.java:911)
    at
    kodo.jdbc.meta.AbstractClassMapping.getFieldMapping(AbstractClassMapp
    ing.java:891)
    at
    kodo.jdbc.meta.AbstractClassMapping.getFieldMapping(AbstractClassMapp
    ing.java:666)
    at
    kodo.jdbc.meta.RuntimeMappingProvider.initialize(RuntimeMappingProvid
    er.java:89)
    at
    kodo.jdbc.meta.MappingRepository.getMappingInternal(MappingRepository
    java:364)
    at
    kodo.jdbc.meta.MappingRepository.getMapping(MappingRepository.java:30
    7)
    at
    kodo.jdbc.meta.MappingRepository.getMapping(MappingRepository.java:16
    2)
    at kodo.jdbc.meta.MappingTool.validate(MappingTool.java:621)
    at kodo.jdbc.meta.MappingTool.run(MappingTool.java:939)
    at kodo.jdbc.meta.MappingTool.run(MappingTool.java:850)
    at kodo.jdbc.meta.MappingTool.main(MappingTool.java:783)
    Exception in thread "main"

    Does Person have any concrete subclasses that map the id field to their
    own table? Do other classes have relations to Person?

  • Internal exception with horizontal mapping

    When two horizontally mapped classes stored with the same ID system comits
    work to database and the throws internal exception. As result corrupt data
    is saved which can not be read back
    1469 TRACE [main] kodo.jdbc.SQL - <t 20688146, conn 20089978> [0 ms]
    executing prepstmnt 3972145 SELECT DISTINCT JDO_CLASS FROM TEST.CONTRACT
    1500 TRACE [main] kodo.jdbc.SQL - <t 20688146, conn 24257622> [0 ms]
    executing prepstmnt 9649099 SELECT t0.JDO_CLASS, t0.JDO_LOCK FROM
    TEST.CONTRACT t0 WHERE t0.CONTRACT_ID = ? [params=(long) 1]
    1563 TRACE [main] kodo.jdbc.SQL - <t 20688146, conn 30008954> [0 ms]
    executing prepstmnt 10233621 INSERT INTO TEST.ORGANIZATION (ACRONYM,
    CONTRACT_ID, JDO_CLASS, JDO_LOCK, NAME, ORG_ID) VALUES (?, ?, ?, ?, ?, ?)
    [params=(null) null, (long) 1, (String) com.peacetech.test.jdo.Organization,
    (int) 0, (null) null, (long) 3]
    1563 TRACE [main] kodo.jdbc.SQL - <t 20688146, conn 30008954> [0 ms]
    executing prepstmnt 3823508 INSERT INTO TEST.PERSON (CONTRACT_ID, JDO_CLASS,
    JDO_LOCK, NAME, NICK_NAME, ORG_ID, PERSON_ID) VALUES (?, ?, ?, ?, ?, ?, ?)
    [params=(long) 1, (String) com.peacetech.test.jdo.Person, (int) 0, (null)
    null, (null) null, (long) 3, (long) 3]
    1563 TRACE [main] kodo.jdbc.SQL - <t 20688146, conn 30008954> [0 ms]
    executing prepstmnt 4973260 INSERT INTO TEST.POST (CONTRACT_ID, JDO_CLASS,
    JDO_LOCK, NAME, ORG_ID, POST_ID, TITLE) VALUES (?, ?, ?, ?, ?, ?, ?)
    [params=(long) 1, (String) com.peacetech.test.jdo.Post, (int) 0, (null)
    null, (long) 3, (long) 3, (null) null]
    1594 TRACE [main] kodo.Runtime - An exception occurred while ending the
    transaction. This exception will be re-thrown.
    kodo.util.FatalInternalException: 3 :: 3:kodo.runtime.PNonTransState@129b0e1
    :: 3:kodo.runtime.PNonTransState@129b0e1
    at
    kodo.runtime.PersistenceManagerImpl.setStateManager(PersistenceManagerImpl.j
    ava:3314)
    at kodo.runtime.StateManagerImpl.commit(StateManagerImpl.java:737)
    at
    kodo.runtime.PersistenceManagerImpl.endTransaction(PersistenceManagerImpl.ja
    va:1103)
    at
    kodo.runtime.PersistenceManagerImpl.afterCompletion(PersistenceManagerImpl.j
    ava:842)
    at kodo.runtime.LocalManagedRuntime.commit(LocalManagedRuntime.java:86)
    at
    kodo.runtime.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:542)
    at
    com.peacetech.test.jdo.TestJDOHelper.commitTransaction(TestJDOHelper.java:40
    at com.peacetech.test.HorizontalTest.insert(HorizontalTest.java:57)
    at com.peacetech.test.HorizontalTest.main(HorizontalTest.java:34)
    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:495)
    at com.intellij.rt.execution.application.AppMain.main(Unknown Source)
    1594 TRACE [main] kodo.Runtime - An exception occurred while ending the
    transaction. This exception will be re-thrown.
    kodo.util.UserException: Can only perform operation while a transaction is
    active.
    at
    kodo.runtime.PersistenceManagerImpl.assertActiveTransaction(PersistenceManag
    erImpl.java:3602)
    at
    kodo.runtime.PersistenceManagerImpl.afterCompletion(PersistenceManagerImpl.j
    ava:840)
    at kodo.runtime.LocalManagedRuntime.rollback(LocalManagedRuntime.java:125)
    at kodo.runtime.LocalManagedRuntime.commit(LocalManagedRuntime.java:101)
    at
    kodo.runtime.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:542)
    at
    com.peacetech.test.jdo.TestJDOHelper.commitTransaction(TestJDOHelper.java:40
    at com.peacetech.test.HorizontalTest.insert(HorizontalTest.java:57)
    at com.peacetech.test.HorizontalTest.main(HorizontalTest.java:34)
    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:495)
    at com.intellij.rt.execution.application.AppMain.main(Unknown Source)
    1594 TRACE [main] kodo.Runtime - An exception occurred while ending the
    transaction. This exception will be re-thrown.
    kodo.util.FatalInternalException: 3 :: 3:kodo.runtime.PNonTransState@129b0e1
    :: 3:kodo.runtime.PNonTransState@129b0e1
    at
    kodo.runtime.PersistenceManagerImpl.setStateManager(PersistenceManagerImpl.j
    ava:3314)
    at kodo.runtime.StateManagerImpl.commit(StateManagerImpl.java:737)
    at
    kodo.runtime.PersistenceManagerImpl.endTransaction(PersistenceManagerImpl.ja
    va:1103)
    at
    kodo.runtime.PersistenceManagerImpl.afterCompletion(PersistenceManagerImpl.j
    ava:842)
    at kodo.runtime.LocalManagedRuntime.commit(LocalManagedRuntime.java:86)
    at
    kodo.runtime.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:542)
    at
    com.peacetech.test.jdo.TestJDOHelper.commitTransaction(TestJDOHelper.java:40
    at com.peacetech.test.HorizontalTest.insert(HorizontalTest.java:57)
    at com.peacetech.test.HorizontalTest.main(HorizontalTest.java:34)
    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:495)
    at com.intellij.rt.execution.application.AppMain.main(Unknown Source)
    Exception in thread "main" kodo.util.FatalInternalException: 3 ::
    3:kodo.runtime.PNonTransState@129b0e1 ::
    3:kodo.runtime.PNonTransState@129b0e1
    at
    kodo.runtime.PersistenceManagerImpl.setStateManager(PersistenceManagerImpl.j
    ava:3314)
    at kodo.runtime.StateManagerImpl.commit(StateManagerImpl.java:737)
    at
    kodo.runtime.PersistenceManagerImpl.endTransaction(PersistenceManagerImpl.ja
    va:1103)
    at
    kodo.runtime.PersistenceManagerImpl.afterCompletion(PersistenceManagerImpl.j
    ava:842)
    at kodo.runtime.LocalManagedRuntime.commit(LocalManagedRuntime.java:86)
    at
    kodo.runtime.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:542)
    at
    com.peacetech.test.jdo.TestJDOHelper.commitTransaction(TestJDOHelper.java:40
    at com.peacetech.test.HorizontalTest.insert(HorizontalTest.java:57)
    at com.peacetech.test.HorizontalTest.main(HorizontalTest.java:34)
    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:495)
    at com.intellij.rt.execution.application.AppMain.main(Unknown Source)
    Process terminated with exit code 1

    Note that this bug is reported at:
    http://bugzilla.solarmetric.com/show_bug.cgi?id=940
    Currently, the only solution is to ensure that you are using globally
    unique IDs. One good way of doing this is to use an application identity
    hierarchy that mirrors the hierarchy of the persistent classes, as
    described in the documentation at:
    http://docs.solarmetric.com/manual.html#horizontal_caveats.
    In article <[email protected]>, Alex Roytman wrote:
    When two horizontally mapped classes stored with the same ID system comits
    work to database and the throws internal exception. As result corrupt data
    is saved which can not be read back
    1469 TRACE [main] kodo.jdbc.SQL - <t 20688146, conn 20089978> [0 ms]
    executing prepstmnt 3972145 SELECT DISTINCT JDO_CLASS FROM TEST.CONTRACT
    1500 TRACE [main] kodo.jdbc.SQL - <t 20688146, conn 24257622> [0 ms]
    executing prepstmnt 9649099 SELECT t0.JDO_CLASS, t0.JDO_LOCK FROM
    TEST.CONTRACT t0 WHERE t0.CONTRACT_ID = ? [params=(long) 1]
    1563 TRACE [main] kodo.jdbc.SQL - <t 20688146, conn 30008954> [0 ms]
    executing prepstmnt 10233621 INSERT INTO TEST.ORGANIZATION (ACRONYM,
    CONTRACT_ID, JDO_CLASS, JDO_LOCK, NAME, ORG_ID) VALUES (?, ?, ?, ?, ?, ?)
    [params=(null) null, (long) 1, (String) com.peacetech.test.jdo.Organization,
    (int) 0, (null) null, (long) 3]
    1563 TRACE [main] kodo.jdbc.SQL - <t 20688146, conn 30008954> [0 ms]
    executing prepstmnt 3823508 INSERT INTO TEST.PERSON (CONTRACT_ID, JDO_CLASS,
    JDO_LOCK, NAME, NICK_NAME, ORG_ID, PERSON_ID) VALUES (?, ?, ?, ?, ?, ?, ?)
    [params=(long) 1, (String) com.peacetech.test.jdo.Person, (int) 0, (null)
    null, (null) null, (long) 3, (long) 3]
    1563 TRACE [main] kodo.jdbc.SQL - <t 20688146, conn 30008954> [0 ms]
    executing prepstmnt 4973260 INSERT INTO TEST.POST (CONTRACT_ID, JDO_CLASS,
    JDO_LOCK, NAME, ORG_ID, POST_ID, TITLE) VALUES (?, ?, ?, ?, ?, ?, ?)
    [params=(long) 1, (String) com.peacetech.test.jdo.Post, (int) 0, (null)
    null, (long) 3, (long) 3, (null) null]
    1594 TRACE [main] kodo.Runtime - An exception occurred while ending the
    transaction. This exception will be re-thrown.
    kodo.util.FatalInternalException: 3 :: 3:kodo.runtime.PNonTransState@129b0e1
    :: 3:kodo.runtime.PNonTransState@129b0e1
    at
    kodo.runtime.PersistenceManagerImpl.setStateManager(PersistenceManagerImpl.j
    ava:3314)
    at kodo.runtime.StateManagerImpl.commit(StateManagerImpl.java:737)
    at
    kodo.runtime.PersistenceManagerImpl.endTransaction(PersistenceManagerImpl.ja
    va:1103)
    at
    kodo.runtime.PersistenceManagerImpl.afterCompletion(PersistenceManagerImpl.j
    ava:842)
    at kodo.runtime.LocalManagedRuntime.commit(LocalManagedRuntime.java:86)
    at
    kodo.runtime.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:542)
    at
    com.peacetech.test.jdo.TestJDOHelper.commitTransaction(TestJDOHelper.java:40
    at com.peacetech.test.HorizontalTest.insert(HorizontalTest.java:57)
    at com.peacetech.test.HorizontalTest.main(HorizontalTest.java:34)
    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:495)
    at com.intellij.rt.execution.application.AppMain.main(Unknown Source)
    1594 TRACE [main] kodo.Runtime - An exception occurred while ending the
    transaction. This exception will be re-thrown.
    kodo.util.UserException: Can only perform operation while a transaction is
    active.
    at
    kodo.runtime.PersistenceManagerImpl.assertActiveTransaction(PersistenceManag
    erImpl.java:3602)
    at
    kodo.runtime.PersistenceManagerImpl.afterCompletion(PersistenceManagerImpl.j
    ava:840)
    at kodo.runtime.LocalManagedRuntime.rollback(LocalManagedRuntime.java:125)
    at kodo.runtime.LocalManagedRuntime.commit(LocalManagedRuntime.java:101)
    at
    kodo.runtime.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:542)
    at
    com.peacetech.test.jdo.TestJDOHelper.commitTransaction(TestJDOHelper.java:40
    at com.peacetech.test.HorizontalTest.insert(HorizontalTest.java:57)
    at com.peacetech.test.HorizontalTest.main(HorizontalTest.java:34)
    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:495)
    at com.intellij.rt.execution.application.AppMain.main(Unknown Source)
    1594 TRACE [main] kodo.Runtime - An exception occurred while ending the
    transaction. This exception will be re-thrown.
    kodo.util.FatalInternalException: 3 :: 3:kodo.runtime.PNonTransState@129b0e1
    :: 3:kodo.runtime.PNonTransState@129b0e1
    at
    kodo.runtime.PersistenceManagerImpl.setStateManager(PersistenceManagerImpl.j
    ava:3314)
    at kodo.runtime.StateManagerImpl.commit(StateManagerImpl.java:737)
    at
    kodo.runtime.PersistenceManagerImpl.endTransaction(PersistenceManagerImpl.ja
    va:1103)
    at
    kodo.runtime.PersistenceManagerImpl.afterCompletion(PersistenceManagerImpl.j
    ava:842)
    at kodo.runtime.LocalManagedRuntime.commit(LocalManagedRuntime.java:86)
    at
    kodo.runtime.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:542)
    at
    com.peacetech.test.jdo.TestJDOHelper.commitTransaction(TestJDOHelper.java:40
    at com.peacetech.test.HorizontalTest.insert(HorizontalTest.java:57)
    at com.peacetech.test.HorizontalTest.main(HorizontalTest.java:34)
    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:495)
    at com.intellij.rt.execution.application.AppMain.main(Unknown Source)
    Exception in thread "main" kodo.util.FatalInternalException: 3 ::
    3:kodo.runtime.PNonTransState@129b0e1 ::
    3:kodo.runtime.PNonTransState@129b0e1
    at
    kodo.runtime.PersistenceManagerImpl.setStateManager(PersistenceManagerImpl.j
    ava:3314)
    at kodo.runtime.StateManagerImpl.commit(StateManagerImpl.java:737)
    at
    kodo.runtime.PersistenceManagerImpl.endTransaction(PersistenceManagerImpl.ja
    va:1103)
    at
    kodo.runtime.PersistenceManagerImpl.afterCompletion(PersistenceManagerImpl.j
    ava:842)
    at kodo.runtime.LocalManagedRuntime.commit(LocalManagedRuntime.java:86)
    at
    kodo.runtime.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:542)
    at
    com.peacetech.test.jdo.TestJDOHelper.commitTransaction(TestJDOHelper.java:40
    at com.peacetech.test.HorizontalTest.insert(HorizontalTest.java:57)
    at com.peacetech.test.HorizontalTest.main(HorizontalTest.java:34)
    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:495)
    at com.intellij.rt.execution.application.AppMain.main(Unknown Source)
    Process terminated with exit code 1
    Marc Prud'hommeaux
    SolarMetric Inc.

  • Using base classes for common attributes

    Can TopLink handle use of non-mapped abstract base classes? There are a number of fields that are common to each and every one of my domain objects which, following good OO design principals, are moved up to a common superclass. So I have:
    public abstract class AbstractDomainObject
    private Integer id;
    private Date dateCreated;
    private Integer creatorId;
    private Date dateModified;
    private Integer modifierId;
    // ... appropriate attribute accessors
    Then a concrete class which gets mappped in Workbench:
    public class Address
    extends AbstractDomainObject
    ... specific attributes
    I tried mapping all the specific attributes explicitly defined in the Address class and then using "Map Inherited Fields > To SuperClass" in Workbench. However, when attempting to test my mappings in the SessionConsole, only the attributes explicitly defined on Address are present in the SELECT clause.
    Can what I am trying be done? If so, how?

    Steve,
    What you are trying to do is very common and the process you described is exactly how map the class. I will summarize a couple of points for mapping this scenario.
    1. You only need to import Address in and map it. If AbstractDomainObject is imported into the Mapping Workbench make sure that it is disabled. The abstract class is only required on the project's CLASSPATH.
    2. You should not enable inheritance for the Address class. Inheritance is for situations where the abstract base class has its own independent table. I am assuming that your Address class has its own table that contains fields for all of the attributes it needs along with those of the abstract base class.
    Assuming these conditions are met then TopLink will work fine with you Address class just as if it had all of the inherited attributes directly.
    If you are still having trouble take a look through your generated project (XML or Java) to ensure that mappings exist in Address for All attributes. If the project looks good then I am at a loss. Customers have been using this pattern of use for over 5 years with TopLink and Java inheritance.
    Cheers,
    Doug

  • Base classes with Collection attributes

    I have a question. Suppose I have a base class A, an abstract base class
    to be exact, and subclasses B and C. Assume A has an attribute of
    Collection type, let's call it collectionImpl. Now I would like subclasses
    B and C to be able to have elements of different types along the lines of
    what I've outlined below.
    Strictly speaking, class A wouldn't have to be PC, since I primarily care
    of B and C but I wanted to show the structure.
    <class name="A" persistence-capable-superclass="A">
    <field name="collectionImpl">
    <collection element type="someType"/>
    </field>
    </class>
    <class name="B" persistence-capable-superclass="A">
    <field name="collectionImpl">
    <collection element type="someOtherType"/>
    </field>
    </class>
    So, how would one express this?
    Scott

    Understood. Now for bit more clarification. Given my earlier example, what
    if classes A, B and C implement the java.util.Collection interface. Does
    Kodo have in issue with that? I know Kodo has this ProxyCollection stuff
    but I don't really want to do that, nor do I think I really need to given
    what I'm trying to accomplish.
    The issue I'm having now is that the Kodo Enhancer is complaining that no
    element-type is declared when I have an attribute of class type B for
    example (implementing java.util.Collection) even though an element type is
    declared for the that actual Collection object held in the base class of B
    (A).
    <class name="A" requires-extent="false">
    <field name="impl">
    <collection element-type="SomeType"/>
    <extension vendor-name="kodo" key="ordered" value="true"/>
    </field>
    </class>
    <class name="B" persistence-capable-superclass="A"
    requires-extent="false"/>
    Class "A" extends java.util.AbstractSet, impl is an instance of
    java.util.Collection.
    All this was working quite well until I made some updates recently
    although the basic implementation is the same. Logically I don't know what
    I might have done to cause the new error message.
    I'm using v2.5.2 BTW.
    Scott
    Stephen Kim wrote:
    The one thing to note is that if you do not make A persistent capable,
    you cannot persist fields -declared- in A or query starting from A.
    Scott A. Leschke wrote:
    Can I acheive the same effect by making A be non-PC and provide a abstract
    protected method that will be used by a to access the collection
    implemented in the sub-classes as you suggest (ie. Collection
    getCollectionImpl())?
    Steve Kim
    [email protected]
    SolarMetric Inc.
    http://www.solarmetric.com

  • FXML and Controller base classes?

    Hey Guys,
    Another FXML question: does anyone know if it is possible to get FXMLLoader to pick up the FXML annotations on base classes?
    If we have this:
    public class MyBaseController
        @FXML
        protected Label myLabel1;
    } And this:
    public class MyController extends MyBaseController
        @FXML
        protected Label myLabel2;  
    } And then we load some FXML that references MyController as its controller, it seems only the direct properties on the Controller class are mapped (i.e. 'myLabel2') and not the inherited ones (i.e. 'myLabel1').
    I'm guessing it just hasn't been written this way?
    Greg - I don't suppose sharing the source code for FXMLLoader is an option? It would certainly help us early users work out what we're doing in lieu of more complete docco.
    Cheers,
    zonski

    Just in case anyone is interested, the answer to this question is currently 'no'.
    JIRA issue for it here: http://javafx-jira.kenai.com/browse/RT-16722

  • AS3: How to create one base class for classes loaded in multiple swfs?

    Our application have 3 different modules and all use
    fscommand and ExternalInterface alot. Now the problem is we are
    combining all those modules, but they all will reside in different
    swfs. Is there any way that they extend to same base class and its
    static members have only one instance accessible by all
    three?

    Hi,
    You can achieve this via Workshop 9.2 by using the exported Ant script for your project as follows:
    -Ensure that all Jars needed to resolve com.bea.p13n.property.EntityPropertyManager (this particular class is found in weblogic92/common/p13n/lib/p13n_ejb.jar) and all referenced classes are added to the Java build path for your WebLogic EJB project (Properties->Java Build Path->Libraries)
    -Export the "Workshop Ant Script" for your WebLogic EJB project (File->Export->Workshop Ant Script); this will generate a "build.xml" Ant script under your project root directory.
    -Edit this default build script as follows: in the call to the "ejbgen" task within the "build" target, add the attribute: propertyFile="ejbgen.properties"
    -Create a file "ejbgen.properties" under the root of your WebLogic EJB project and add the following entry:
    YourSessionBeanClassName.remote.baseClass=com.bea.p13n.property.EntityPropertyManager
    -Add a "<path refid="java.classpath"/>" within the "<classpath>" for the "java" task element that calls "weblogic.ejbc" (this will ensure that the p13n classes are resolved by EJBC)
    Follow the instructions for executing the Ant build script found here: http://edocs.bea.com/workshop/docs92/ws_platform/ideuserguide/conUseCustomAntBuild.html
    For more information on the EJBGen property file support, see: http://e-docs.bea.com/wls/docs92/ejb/EJBGen_reference.html

Maybe you are looking for

  • E-mail a Single Page from a PDF document.

    How do you e-mail a single page from a PDF document that has multiple pages? When I go to File > Attach E-mail in Adobe it e-mails the whole document and I do not want that. I just want to e-mail selected pages and not the whole document. How can I d

  • Report Painter - Display Report

    Dear Friends, While displaying/changing Z reports from GRR3 transaction, we are getting short dump. The dump does not occur for standard transactions. The error occuring is: The current application program detected a situation which really should not

  • HT4972 ipad 1 unable to acivate after firm 5.1.1 update

    says..."your ipad could not be activated because the activation server is temporarily unavailable"  this has been going on for a week, also error thru itunes

  • Email settings and syncing

    I have a couple of questions on the stock email program. 1. For one of my accounts, I prefer that email not be automatically synced - it's an account that I want, on occasion, to check manually. However, there seems to be no "No sync" option. I could

  • Create Dynamic reports

    Post Author: Thomas Gyllencreutz CA Forum: Crystal Reports Hi!In Crystal Reports 8.5 there is 2 functions AddTextObject and AddFieldObject that allows me to add objects on-the-fly on a blank report. I cant find these methods anywhere in Business Obje