3.1.4 reverse mapping tool issue

(Sorry for the duplicate posting...I meant to start a new thread with
this but accidentally posted it as a reply to a 6-month old thread)
Hello,
I was running Kodo 3.0.2 when Abe and I had the exchange reproduced
below back in January to deal with Oracle tables with "$" in the column
names (which I subsequently updated to 3.0.3). The original subject of
this discussion was "3.0.2 reverse mapping tool generates invalid
..mapping file".
I was able to get this working by running the following commands to
implement Abe's suggestion:
reversemappingtool -p kodo.properties -package db \
-cp custom.properties -ds false schema.xml
sed -e 's/\$/__DOLLAR__/' db/package.mapping > db/package.mapping.new
mv db/package.mapping.new db/package.mapping
javac db/*.java
mappingtool -p kodo.properties -a import db/package.mapping
sed -e 's/__DOLLAR__/\$/' db/package.jdo > db/package.jdo.new
mv db/package.jdo.new db/package.jdo
In my custom.properties file, I had lines like these to put useful names
on my class's fields:
db.TransactionDetailHistory.y$an8.rename : addressNumber
As I said, in 3.0.3, this worked perfectly.
I picked this code back up for the first time since getting it working 6
months ago, and decided to update it to 3.1.4 (since I'm already using
that on other projects). Problem is, the reverse mapping tool has
changed and the code it generates no longer works as it once did. I
tried running the 3.1.2 and 3.1.0 reverse mapping tool, and it failed
the same way, so it looks like this change happened in the 3.0.x to
3.1.x version change.
What happens is this: In the generated Java source, my fields used to
end up with names as per my specification (e.g., the Oracle column named
"y$an8" showed up as "addressNumber" in the java source).
However, it looks like the "$" became special somehow in 3.1.0 - the
"y$an8" column now shows up as "yAn8" in the generated Java. I tried
changing my custom.properties file accordingly, but it still shows up as
yAn8 even after changing my mapping to look like this:
db.TransactionDetailHistory.yAn8.rename : addressNumber
What do you make of this?
Thanks,
Bill
Abe White wrote:
> Hmmm... this is a problem. '$' is not legal in XML names, and there
is no standard way to escape it.
>
> Your best bet is probably to do the following:
> 1. In the generated .mapping file, replace all '$' characters with
another token, such as '--DOLLAR--'.
> 2. Switch your properties to use the metadata mapping factory:
> kodo.jdbc.MappingFactory: metadata
> 3. Import your mappings into the metadata mapping factory:
> mappingtool -a import package.mapping
> 4. Delete the mapping file.
> 5. In your .jdo file, replace '--DOLLAR--' with '$' again.
>
> The metadata mapping factory doesn't put column names in its XML
attribute names, so you should be able to use it safely.

William-
However, it looks like the "$" became special somehow in 3.1.0 - the
"y$an8" column now shows up as "yAn8" in the generated Java. I tried
changing my custom.properties file accordingly, but it still shows up as
yAn8 even after changing my mapping to look like this:
db.TransactionDetailHistory.yAn8.rename : addressNumberWell, the reverse mapping tool makes some assumptions based on common
naming strategies for relational databases and Java naming: columns like
"FIRST_NAME" will be renamed to "firstName". The Reverse Mapping tool is
seeing the "$" and treating it as a non-alphanumeric delimiter, so is
fixing it.
Can you try a couple of additional properties:
db.TransactionDetailHistory.y$An8.rename: addressNumber
db.TransactionDetailHistory.y$an8.rename: addressNumber
Also, are other rename properties working for you, or is that the only
field or class you attempt to rename? It might just be the case that
you aren't correctly specifying the properties file or something.
Finally, bear in mind that you can always implement your own
kodo.jdbc.meta.ReverseCustomizer and just use that; not the easiest
solution, but it can certainly be used to have very fine-grained control
over the exact names that are generated.
In article <[email protected]>, William Korb wrote:
(Sorry for the duplicate posting...I meant to start a new thread with
this but accidentally posted it as a reply to a 6-month old thread)
Hello,
I was running Kodo 3.0.2 when Abe and I had the exchange reproduced
below back in January to deal with Oracle tables with "$" in the column
names (which I subsequently updated to 3.0.3). The original subject of
this discussion was "3.0.2 reverse mapping tool generates invalid
.mapping file".
I was able to get this working by running the following commands to
implement Abe's suggestion:
reversemappingtool -p kodo.properties -package db \
-cp custom.properties -ds false schema.xml
sed -e 's/\$/__DOLLAR__/' db/package.mapping > db/package.mapping.new
mv db/package.mapping.new db/package.mapping
javac db/*.java
mappingtool -p kodo.properties -a import db/package.mapping
sed -e 's/__DOLLAR__/\$/' db/package.jdo > db/package.jdo.new
mv db/package.jdo.new db/package.jdo
In my custom.properties file, I had lines like these to put useful names
on my class's fields:
db.TransactionDetailHistory.y$an8.rename : addressNumber
As I said, in 3.0.3, this worked perfectly.
I picked this code back up for the first time since getting it working 6
months ago, and decided to update it to 3.1.4 (since I'm already using
that on other projects). Problem is, the reverse mapping tool has
changed and the code it generates no longer works as it once did. I
tried running the 3.1.2 and 3.1.0 reverse mapping tool, and it failed
the same way, so it looks like this change happened in the 3.0.x to
3.1.x version change.
What happens is this: In the generated Java source, my fields used to
end up with names as per my specification (e.g., the Oracle column named
"y$an8" showed up as "addressNumber" in the java source).
However, it looks like the "$" became special somehow in 3.1.0 - the
"y$an8" column now shows up as "yAn8" in the generated Java. I tried
changing my custom.properties file accordingly, but it still shows up as
yAn8 even after changing my mapping to look like this:
db.TransactionDetailHistory.yAn8.rename : addressNumber
What do you make of this?
Thanks,
Bill
Abe White wrote:
Hmmm... this is a problem. '$' is not legal in XML names, and thereis no standard way to escape it.
Your best bet is probably to do the following:
1. In the generated .mapping file, replace all '$' characters withanother token, such as '--DOLLAR--'.
2. Switch your properties to use the metadata mapping factory:
kodo.jdbc.MappingFactory: metadata
3. Import your mappings into the metadata mapping factory:
mappingtool -a import package.mapping
4. Delete the mapping file.
5. In your .jdo file, replace '--DOLLAR--' with '$' again.
The metadata mapping factory doesn't put column names in its XMLattribute names, so you should be able to use it safely.--
Marc Prud'hommeaux
SolarMetric Inc.

Similar Messages

  • Reverse mapping tool in 3.0.1 ignores "-schemas" option

    I believe I have discovered a bug in the 3.0.1 version of the reverse
    mapping tool.
    Here is a script of the commands that worked fine in 3.0.0:
    Script started on Mon Jan 12 11:02:19 2004
    1$ which schemagen
    /opt/kodo-jdo-3.0.0/bin/schemagen
    2$ echo $PATH
    /opt/kodo-jdo-3.0.0/bin:/sw/db/oracle/oracle817/bin:/sw/gen/sparc-sun-solaris2.9/acroread/5.06/bin:/sw/gen/sparc-sun-solaris2.9/cvs/1.11.5/bin:/sw/gen/sparc-sun-solaris2.9/esound/0.2.29/bin:/sw/gen/sparc-sun-solaris2.9/mpg123/0.59r/bin:/usr/bin:/sw/gen/sparc-sun-solaris2.9/gnupg/1.2.1/bin:/sw/gen/sparc-sun-solaris2.9/mozilla/1.3/bin:/sw/gen/sparc-sun-solaris2.9/openssh/3.7.1p2/sbin:/sw/gen/sparc-sun-solaris2.9/openssh/3.7.1p2/bin:/sw/pd/workman-1.3.4/bin:/usr/openwin/bin:/usr/bin:/sbin:/bin:/usr/sbin:/usr/ccs/bin:/usr/ucb:/opt/local/bin:/sw/modules/bin:/sw/com/bin:/sw/pd/bin:/sw/pd/office52/program:/sw/pd/RealPlayer8:/users/n9208/bin:/opt/openssh/bin:/usr/dt/bin:/usr/dt/bin:/usr/openwin/bin:/sw/db/tools/bin:/sw/db/iss/bin:/usr/local/bin:/usr/local/scripts
    3$ echo $CLASSPATH
    :/opt/oracle/oracle9.0.1.4.zip:/opt/kodo-jdo-3.0.0:/opt/kodo-jdo-3.0.0/lib/kodo-jdo-runtime.jar:/opt/kodo-jdo-3.0.0/lib/kodo-jdo.jar:/opt/kodo-jdo-3.0.0/lib/jakarta-commons-collections-2.1.jar:/opt/kodo-jdo-3.0.0/lib/jakarta-commons-lang-1.0.1.jar:/opt/kodo-jdo-3.0.0/lib/jakarta-commons-logging-1.0.3.jar:/opt/kodo-jdo-3.0.0/lib/jakarta-commons-pool-1.0.1.jar:/opt/kodo-jdo-3.0.0/lib/jakarta-regexp-1.1.jar:/opt/kodo-jdo-3.0.0/lib/jca1.0.jar:/opt/kodo-jdo-3.0.0/lib/jdbc-hsql-1_7_0.jar:/opt/kodo-jdo-3.0.0/lib/jdbc2_0-stdext.jar:/opt/kodo-jdo-3.0.0/lib/jdo-1.0.1.jar:/opt/kodo-jdo-3.0.0/lib/jndi.jar:/opt/kodo-jdo-3.0.0/lib/jta-spec1_0_1.jar:/opt/kodo-jdo-3.0.0/lib/log4j-1.2.6.jar:/opt/kodo-jdo-3.0.0/lib/xalan.jar:/opt/kodo-jdo-3.0.0/lib/xercesImpl.jar:/opt/kodo-jdo-3.0.0/lib/xml-apis.jar:/opt/kodo-jdo-3.0.0/lib/jfreechart-0.9.13.jar:/opt/kodo-jdo-3.0.0/lib/jcommon-0.8.8.jar
    4$ schemagen -p kodo.properties -f schema.xml -schemas PRODTRDTA.F0101
    0 INFO [main] kodo.Tool - Schema generator running on schemas
    "PRODTRDTA.F0101". This process may take some time. Enable the
    kodo.jdbc.Schema logging category to see messages about the collection of
    schema data.
    136 INFO [main] jdbc.Schema - Reading table information for schema name
    "PRODTRDTA", table name "F0101".
    672 INFO [main] jdbc.Schema - Reading column information for table
    "PRODTRDTA.F0101".
    727 INFO [main] jdbc.Schema - Reading primary keys for schema name
    "PRODTRDTA", table name "F0101".
    2187 INFO [main] jdbc.Schema - Reading indexes for schema name
    "PRODTRDTA", table name "F0101".
    2432 INFO [main] jdbc.Schema - Reading foreign keys for schema name
    "PRODTRDTA", table name "F0101".
    2632 INFO [main] kodo.Tool - Writing XML schema.
    5$
    script done on Mon Jan 12 11:03:14 2004
    Note the first line of logging output: both the schema name and table name
    are properly recognized.
    Here is the scripted output of the same commands in 3.0.1:
    Script started on Mon Jan 12 10:29:03 2004
    1$ which schemagen
    /opt/kodo-jdo-3.0.1/bin/schemagen
    2$ echo $PATH
    /opt/kodo-jdo-3.0.1/bin:/sw/db/oracle/oracle817/bin:/sw/gen/sparc-sun-solaris2.9/acroread/5.06/bin:/sw/gen/sparc-sun-solaris2.9/cvs/1.11.5/bin:/sw/gen/sparc-sun-solaris2.9/esound/0.2.29/bin:/sw/gen/sparc-sun-solaris2.9/mpg123/0.59r/bin:/usr/bin:/sw/gen/sparc-sun-solaris2.9/gnupg/1.2.1/bin:/sw/gen/sparc-sun-solaris2.9/mozilla/1.3/bin:/sw/gen/sparc-sun-solaris2.9/openssh/3.7.1p2/sbin:/sw/gen/sparc-sun-solaris2.9/openssh/3.7.1p2/bin:/sw/pd/workman-1.3.4/bin:/usr/openwin/bin:/usr/bin:/sbin:/bin:/usr/sbin:/usr/ccs/bin:/usr/ucb:/opt/local/bin:/sw/modules/bin:/sw/com/bin:/sw/pd/bin:/sw/pd/office52/program:/sw/pd/RealPlayer8:/users/n9208/bin:/opt/openssh/bin:/usr/dt/bin:/usr/dt/bin:/usr/openwin/bin:/sw/db/tools/bin:/sw/db/iss/bin:/usr/local/bin:/usr/local/scripts
    3$ echo $CLASSPATH
    :/opt/oracle/oracle9.0.1.4.zip:/opt/kodo-jdo-3.0.1:/opt/kodo-jdo-3.0.1/lib/kodo-jdo-runtime.jar:/opt/kodo-jdo-3.0.1/lib/kodo-jdo.jar:/opt/kodo-jdo-3.0.1/lib/jakarta-commons-collections-2.1.jar:/opt/kodo-jdo-3.0.1/lib/jakarta-commons-lang-1.0.1.jar:/opt/kodo-jdo-3.0.1/lib/jakarta-commons-logging-1.0.3.jar:/opt/kodo-jdo-3.0.1/lib/jakarta-commons-pool-1.0.1.jar:/opt/kodo-jdo-3.0.1/lib/jakarta-regexp-1.1.jar:/opt/kodo-jdo-3.0.1/lib/jca1.0.jar:/opt/kodo-jdo-3.0.1/lib/jdbc-hsql-1_7_0.jar:/opt/kodo-jdo-3.0.1/lib/jdbc2_0-stdext.jar:/opt/kodo-jdo-3.0.1/lib/jdo-1.0.1.jar:/opt/kodo-jdo-3.0.1/lib/jndi.jar:/opt/kodo-jdo-3.0.1/lib/jta-spec1_0_1.jar:/opt/kodo-jdo-3.0.1/lib/log4j-1.2.6.jar:/opt/kodo-jdo-3.0.1/lib/xalan.jar:/opt/kodo-jdo-3.0.1/lib/xercesImpl.jar:/opt/kodo-jdo-3.0.1/lib/xml-apis.jar:/opt/kodo-jdo-3.0.1/lib/jfreechart-0.9.13.jar:/opt/kodo-jdo-3.0.1/lib/jcommon-0.8.8.jar:/opt/kodo-jdo-3.0.1/lib/jline.jar:/opt/kodo-jdo-3.0.1/lib/sqlline.jar
    4$ schemagen -p kodo.properties -f schema.xml -schemas PRODTRDTA.F0101
    1 INFO [main] kodo.Tool - Schema generator running on schemas "all".
    This process may take some time. Enable the kodo.jdbc.Schema logging
    category to see messages about the collection of schema data.
    103 INFO [main] jdbc.Schema - Reading table information for schema name
    "null", table name "null".
    Exception in thread "main" java.lang.OutOfMemoryError
    5$
    script done on Mon Jan 12 11:01:45 2004
    Note the first line of logging output here: the schema is listed as "all"
    instead of the limited scope I had specified.
    This run eventually crashes due to the fact that the account which I am
    running the mapping tool in has access to thousands of tables, and thus
    eventually the JVM runs out of available heap.
    My workaround is to fall back to 3.0.0.

    Thanks for the report. We noticed this ourselves a short while ago.
    The bug will be fixed in 3.0.2.

  • Problem with reverse mapping

    Hi!
    I am having a problem with reverse mapping. Here's what I do (copying the
    generated files to a correct directory omitted):
    % rd-schemagen -properties jdo.properties -file schema.xml
    % rd-reversemappingtool -properties jdo.properties -package testi
    schema.xml
    % javac -d build/classes src/testi/*.java
    % rd-importtool -properties jdo.properties src/testi/testi.mapping
    Here's a part of the output:
    <clip>
    2958 INFO [main] jdbc.Schema - Found existing table "Kirja" for schema
    "null".
    3002 INFO [main] jdbc.Schema - Found existing table "Kustantaja" for
    schema "n
    ull".
    3047 INFO [main] jdbc.SQL - [C: 5948361; T: 15336018]close
    3125 INFO [main] jdbc.SQL - [C: 2478770; T: 15336018]open:
    jdbc:mysql://localh
    ost/kirjakauppa (root)
    3129 INFO [main] jdbc.Schema - Found existing table "Kirjailija" for
    schema "n
    ull".
    3140 INFO [main] jdbc.SQL - [C: 2478770; T: 15336018]close
    3187 INFO [main] jdbc.SQL - [C: 7529545; T: 15336018]open:
    jdbc:mysql://localh
    ost/kirjakauppa (root)
    3193 INFO [main] jdbc.Schema - Found existing table "Kirjoittaja" for
    schema "
    null".
    3225 INFO [main] jdbc.SQL - [C: 7529545; T: 15336018]close
    Exception in thread "main" javax.jdo.JDOFatalInternalException:
    java.lang.Illega
    lArgumentException: You are attempting to link to a primary key column in
    table "Kirja" in a foreign key that is already linked to primary key
    columns in table "Kirjailija".
    NestedThrowables:
    java.lang.IllegalArgumentException: You are attempting to link to a primary
    key column in table "Kirja" in a foreign key that is already linked to
    primary key c
    olumns in table "Kirjailija".
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.Mappings.createClassMapping(Ma
    ppings.java:160)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.MappingRepository.getMapping(M
    appingRepository.java:279)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.MappingRepository.getMetaData(
    MappingRepository.java:147)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.MappingRepository.getMapping(M
    appingRepository.java:158)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.compat.ImportTool.getMapping(I
    mportTool.java:126)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.compat.ImportTool.importMappin
    gs(ImportTool.java:57)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.compat.ImportTool.run(ImportTo
    ol.java:408)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.compat.ImportTool.main(ImportT
    ool.java:385)
    NestedThrowablesStackTrace:
    java.lang.IllegalArgumentException: You are attempting to link to a primary
    key column in table "Kirja" in a foreign key that is already linked to
    primary key c
    olumns in table "Kirjailija".
    at
    com.solarmetric.rd.kodo.impl.jdbc.schema.ForeignKey.join(ForeignKey.j
    ava:238)
    at
    com.solarmetric.rd.kodo.impl.jdbc.schema.SchemaGenerator.generateFore
    ignKeys(SchemaGenerator.java:625)
    at
    com.solarmetric.rd.kodo.impl.jdbc.schema.DynamicSchemaFactory.findTab
    le(DynamicSchemaFactory.java:111)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.map.BaseClassMapping.fromMappi
    ngInfo(BaseClassMapping.java:113)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.Mappings.createClassMapping(Ma
    ppings.java:144)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.MappingRepository.getMapping(M
    appingRepository.java:279)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.MappingRepository.getMetaData(
    MappingRepository.java:147)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.MappingRepository.getMapping(M
    appingRepository.java:158)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.compat.ImportTool.getMapping(I
    mportTool.java:126)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.compat.ImportTool.importMappin
    gs(ImportTool.java:57)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.compat.ImportTool.run(ImportTo
    ol.java:408)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.compat.ImportTool.main(ImportT
    ool.java:385)
    </clip>
    Here's what MySQLCC gives for creation statement of the tables:
    <clip>
    # Host: localhost
    # Database: kirjakauppa
    # Table: 'Asiakas'
    # CREATE TABLE `Asiakas` (
    `Asiakas_id` int(11) NOT NULL auto_increment,
    `Nimi1` varchar(50) default NULL,
    `Nimi2` varchar(50) default NULL,
    `KatuOsoite` varchar(50) default NULL,
    `Postiosoite` varchar(50) default NULL,
    `Email` varchar(50) default NULL,
    `Puhelin` varchar(50) default NULL,
    `Fax` varchar(50) default NULL,
    `Salasana` varchar(50) default NULL,
    `ExtranetTunnus` varchar(50) default NULL,
    PRIMARY KEY (`Asiakas_id`),
    KEY `Asiakas_id` (`Asiakas_id`)
    ) TYPE=InnoDB;
    # Host: localhost
    # Database: kirjakauppa
    # Table: 'Kirja'
    # CREATE TABLE `Kirja` (
    `Kirja_id` int(11) NOT NULL auto_increment,
    `Kustantaja_id` int(11) default NULL,
    `Nimi` varchar(60) default NULL,
    `Nimi2` varchar(60) default NULL,
    `ISBN` varchar(50) default NULL,
    `Kieli` varchar(50) default NULL,
    `Kansi_URL` varchar(50) default NULL,
    `Sisalto_URL` varchar(50) default NULL,
    `Tukkuhinta` decimal(10,2) default NULL,
    `Kuluttajahinta` decimal(10,2) default NULL,
    `Varastokpl` int(11) default NULL,
    PRIMARY KEY (`Kirja_id`),
    KEY `Kirja_id` (`Kirja_id`),
    KEY `Kustantaja_id` (`Kustantaja_id`),
    FOREIGN KEY (`Kustantaja_id`) REFERENCES `kirjakauppa.Kustantaja`
    (`Kustantaja_id`)
    ) TYPE=InnoDB;
    # Host: localhost
    # Database: kirjakauppa
    # Table: 'Kirjailija'
    # CREATE TABLE `Kirjailija` (
    `Kirjailija_id` int(11) NOT NULL auto_increment,
    `Sukunimi` varchar(50) default NULL,
    `Etunimi` varchar(50) default NULL,
    `Maa` varchar(50) default NULL,
    `Kirjailija_URL` varchar(50) default NULL,
    PRIMARY KEY (`Kirjailija_id`),
    KEY `Kirjailija_id` (`Kirjailija_id`)
    ) TYPE=InnoDB;
    # Host: localhost
    # Database: kirjakauppa
    # Table: 'Kirjoittaja'
    # CREATE TABLE `Kirjoittaja` (
    `Kirjoittaja_id` int(11) NOT NULL auto_increment,
    `Kirjailija_id` int(11) NOT NULL default '0',
    `Kirja_id` int(11) NOT NULL default '0',
    PRIMARY KEY (`Kirjoittaja_id`),
    KEY `Kirjailija_id` (`Kirjailija_id`),
    KEY `Kirja_id` (`Kirja_id`),
    FOREIGN KEY (`Kirjailija_id`) REFERENCES `kirjakauppa.Kirjailija`
    (`Kirjailija_id`),
    FOREIGN KEY (`Kirja_id`) REFERENCES `kirjakauppa.Kirja` (`Kirja_id`)
    ) TYPE=InnoDB;
    # Host: localhost
    # Database: kirjakauppa
    # Table: 'Koodi'
    # CREATE TABLE `Koodi` (
    `Koodi_id` int(11) NOT NULL auto_increment,
    `Koodi` varchar(50) default NULL,
    `Tyyppi` varchar(50) default NULL,
    `Arvo` varchar(50) default NULL,
    PRIMARY KEY (`Koodi_id`)
    ) TYPE=InnoDB;
    # Host: localhost
    # Database: kirjakauppa
    # Table: 'Kustantaja'
    # CREATE TABLE `Kustantaja` (
    `Kustantaja_id` int(11) NOT NULL auto_increment,
    `Nimi` varchar(80) default NULL,
    `Maa` varchar(50) default NULL,
    `Kustantaja_URL` varchar(50) default NULL,
    `KirjaLkm` int(11) default NULL,
    PRIMARY KEY (`Kustantaja_id`),
    KEY `Kustantaja_id` (`Kustantaja_id`)
    ) TYPE=InnoDB;
    # Host: localhost
    # Database: kirjakauppa
    # Table: 'Luokittelu'
    # CREATE TABLE `Luokittelu` (
    `Luokittelu_id` int(11) NOT NULL auto_increment,
    `Luokka_id` int(11) NOT NULL default '0',
    `Kirja_id` int(11) NOT NULL default '0',
    PRIMARY KEY (`Luokittelu_id`),
    KEY `Luokka_id` (`Luokka_id`),
    KEY `Kirja_id` (`Kirja_id`),
    FOREIGN KEY (`Luokka_id`) REFERENCES `kirjakauppa.Luokka` (`Luokka_id`),
    FOREIGN KEY (`Kirja_id`) REFERENCES `kirjakauppa.Kirja` (`Kirja_id`)
    ) TYPE=InnoDB;
    # Host: localhost
    # Database: kirjakauppa
    # Table: 'Luokka'
    # CREATE TABLE `Luokka` (
    `Luokka_id` int(11) NOT NULL auto_increment,
    `Luokka` varchar(50) default NULL,
    PRIMARY KEY (`Luokka_id`),
    KEY `Luokka_id` (`Luokka_id`)
    ) TYPE=InnoDB;
    # Host: localhost
    # Database: kirjakauppa
    # Table: 'Myyja'
    # CREATE TABLE `Myyja` (
    `Myyja_id` int(11) NOT NULL auto_increment,
    `Myyja` varchar(50) default NULL,
    `Myyja_URL` varchar(50) default NULL,
    PRIMARY KEY (`Myyja_id`),
    KEY `Myyja_id` (`Myyja_id`)
    ) TYPE=InnoDB;
    # Host: localhost
    # Database: kirjakauppa
    # Table: 'Tilaus'
    # CREATE TABLE `Tilaus` (
    `Tilaus_id` int(11) NOT NULL auto_increment,
    `Asiakas_id` int(11) NOT NULL default '0',
    `Myyja_id` int(11) default NULL,
    `TilausPvm` timestamp(14) NOT NULL,
    `EnsimmToimitusPvm` timestamp(14) NOT NULL,
    `ViimToimitusPvm` timestamp(14) NOT NULL,
    `Tila` int(11) NOT NULL default '0',
    `Mk` decimal(10,2) default NULL,
    PRIMARY KEY (`Tilaus_id`),
    KEY `Asiakas_id` (`Asiakas_id`),
    KEY `Myyja_id` (`Myyja_id`),
    KEY `Tilaus_id` (`Tilaus_id`),
    FOREIGN KEY (`Asiakas_id`) REFERENCES `kirjakauppa.Asiakas`
    (`Asiakas_id`),
    FOREIGN KEY (`Myyja_id`) REFERENCES `kirjakauppa.Myyja` (`Myyja_id`)
    ) TYPE=InnoDB;
    # Host: localhost
    # Database: kirjakauppa
    # Table: 'Tilausrivi'
    # CREATE TABLE `Tilausrivi` (
    `TilausRivi_id` int(11) NOT NULL auto_increment,
    `Tilaus_id` int(11) NOT NULL default '0',
    `Kirja_id` int(11) NOT NULL default '0',
    `TilausLkm` int(11) default NULL,
    `Ahinta` decimal(10,2) default NULL,
    `Alepros` float default NULL,
    `Mk` decimal(10,2) default NULL,
    `ToimitettuLkm` int(11) default NULL,
    `ToimitusPvm` timestamp(14) NOT NULL,
    `ViimToimitusPvm` timestamp(14) NOT NULL,
    `Tila` int(11) NOT NULL default '0',
    PRIMARY KEY (`TilausRivi_id`),
    KEY `Tilaus_id` (`Tilaus_id`),
    KEY `Kirja_id` (`Kirja_id`),
    FOREIGN KEY (`Tilaus_id`) REFERENCES `kirjakauppa.Tilaus` (`Tilaus_id`),
    FOREIGN KEY (`Kirja_id`) REFERENCES `kirjakauppa.Kirja` (`Kirja_id`)
    ) TYPE=InnoDB;
    </clip>
    I can find the original creation script if it is necessary.
    My guess was that I need to define the foreign keys myself into the
    generated schema.xml This is stated in the manual. However, this did not
    help, although it changed the stack trace a little (it complains about
    different classes than before):
    <clip>
    Exception in thread "main" javax.jdo.JDOFatalInternalException:
    java.lang.IllegalArgumentException: You are attempting to link to a primary
    key column in table "Myyja" in a foreign key that is already linked to
    primary key columns in table "Asiakas".
    NestedThrowables:
    java.lang.IllegalArgumentException: You are attempting to link to a primary
    key column in table "Myyja" in a foreign key that is already linked to
    primary key columns in table "Asiakas".
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.Mappings.createFieldMapping(Mappings.java:208)
    </clip>
    I don't think I fully understand the error message, what exactly is wrong
    here? How can I fix it?
    Here's a sample of the changes I made to schema.xml:
    - added the name - attribute to schema (it was missing)
    <schema name="kirjakauppa">
    - added the foreign key elements according to the table creation statements
    given above
    <fk name="Kustantaja_id" to-table="Kustantaja" column="Kustantaja_id"/>
         etc...
    -Antti

    On Mon, 16 Jun 2003 17:55:35 -0500, Abe White <[email protected]>
    wrote:
    It seems the last three options are being ignored - I still get a
    mapping
    file with schema names in front of tables (e.g. kirjakauppa.Asiakas, not
    Asiakas),That, unfortunately, is impossible to turn off. The -useSchemaName
    option controls whether the schema name is included as part of the
    generated class name; it doesn't affect the mapping data that is
    generated. What problems does including the schema name in the mapping
    data cause?
    rd-importtool -properties jdo.properties gensrc/testi/testi.mapping0 INFO [main] kodo.MetaData - Parsing metadata resource
    "file:/home/akaranta/work/kurssit/jdo/Harjoituskoodi/kirjakauppa/gensrc/testi/testi.mapping".
    Exception in thread "main"
    com.solarmetric.rd.kodo.meta.JDOMetaDataNotFoundException: No JDO metadata
    was found for type "class testi.Asiakas".
    FailedObject:class testi.Asiakas
    at
    com.solarmetric.rd.kodo.meta.JDOMetaDataRepositoryImpl.getMetaData(JDOMetaDataRepositoryImpl.java:126)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.MappingRepository.getMetaData(MappingRepository.java:184)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.MappingRepository.getMapping(MappingRepository.java:197)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.compat.ImportTool.getMapping(ImportTool.java:128)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.compat.ImportTool.importMappings(ImportTool.java:60)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.compat.ImportTool.run(ImportTool.java:400)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.compat.ImportTool.main(ImportTool.java:377)
    This exception goes away if I edit the schema name out of the mapping
    file from all classes.
    separate classes are being generated for join tables with
    primary keysDo these join tables have an extra primary key column? TheYes, they do. Ok, now I know where the problem is.
    -primaryKeyOnJoin flag tells Kodo to ignore a join table with a primary
    key on the join columns. But Kodo can't handle join tables with extra
    column(s) just for a primary key identifier. This isn't a limitation of
    the reverse mapping tool, it's a limitation of Kodo. Kodo wouldn't know
    what to insert in those extra primary key column(s) when adding membersWhy not? If it can handle single numeric pk columns when making the
    generated classes use data store identity, it has to generate something to
    those columns. I can't see why this is different.
    That is simply out of curiosity - the next thing fixed my problem:
    to the join table. Of course, if the primary key is an auto-increment or
    something where Kodo can ignore it for inserts, you can just remove the
    <column> elements and the <pk> element from your .schema file and the
    reverse mapping tool will map it as a join table appropriately.It is auto-increment, so I did this and it worked. Thanks.
    , and application id is used for all classes.Are your primary keys on single, numeric columns? Kodo uses Java longsYes (int in MySQL), so that should not be a problem. They are also auto-
    incremented. This seems to be the only real problem remaining with this
    schema.
    -Antti

  • Unrecognized types in Reverse Mapping

    In our database schema there is use of a user-defined database type. The
    reverse mapping tool cannot recogize this type and automatically
    classifies it as a blob in the mapping file and the generic Object for the
    java sources. I would like to cast this user-defined type to a String in
    java, because otherwise kodo blows up when I try to retrieve the field. I
    extended PropertiesReverseCustomizer and was able to get the java sources
    to output String instead. But I couldn't find an easy way of getting the
    mapping file to use "value" instead of "blob". Right now I am having to do
    a query replace on the mapping file, but I would like to know if there's
    way of getting the Reverse mapping tool to do this for you?
    Toby

    You can probably just add the fields for UDT types manually in your
    customizer:
    import java.sql.*;
    import kodo.meta.*;
    import kodo.jdbc.meta.*;
    import kodo.jdbc.schema.*;
    private ReverseMappingTool tool; // set in setTool ()
    public boolean customize (ClassMapping cls)
    Column[] cols = cls.getTable ().getColumns ();
    for (int i = 0; i < cols.length; i++)
    if (cols.isCompatible (Types.BLOB, 0))
    addStringField (cls, cols[i]);
    return super.customize (cls);
    private void addStringField (ClassMapping cls, Column col)
    String name = tool.getFieldName (col.getName (), cls);
    FieldMetaData fmd = tool.newFieldMetaData (name, String.class, cls);
    ValueFieldMapping field = new ValueFieldMapping (fmd);
    mapping.setColumn (col);
    tool.addFieldMapping (field, cls);

  • Reverse Mapping: letting Kodo manage pk-column

    Hi again,
    i have a db with many predefined tables. Its not allowed to change the db
    schema. The generated Java-classes are looking fine but i want to let kodo
    manage the pk columns (like JDOIDX in generated tables). I dont want the
    more technical pks in my business classes. Is it possible?
    Any help is welcome!

    Abe White wrote:
    Adding a data store identity option to the reverse mapping tool is relatively
    high on our to-do list, but it's not implemented yet. For now, you can
    follow the steps in the documentation for reverse-mapping your classes, then
    switch over to datastore identity manually by changing the class definitions
    and metadata.Ok, this solution is workable. Will try it, thanks!

  • Reverse Map Schema

    While trying to run the reverse mapping tool on an existing Oracle
    Database(Version 9.2.0.1), I am getting an error "An Error occurred while
    accessing the Schema". Do we need some special settings in the Kodo
    Workbench other than the connection settings? Am I missing something?
    Here is my config settings...
    For the driver class : oracle.jdbc.driver.OracleDriver
    For the Connection URL :jdbc:oracle:thin:@IPAddress:1521:DBNAME

    By the way, if you launch the tool from the start menu, then it will
    probably use javaw and there will be no stack trace.
    "Marc Prud'hommeaux" <[email protected]> wrote in message
    news:[email protected]..
    Vijay-
    Can you post the complete stack trace of the exception?
    In article <cpkg6d$q7v$[email protected]>, Vijay Kumar Narayanan
    wrote:
    >>
    While trying to run the reverse mapping tool on an existing Oracle
    Database(Version 9.2.0.1), I am getting an error "An Error occurredwhile
    accessing the Schema". Do we need some special settings in the Kodo
    Workbench other than the connection settings? Am I missing something?
    Here is my config settings...
    For the driver class : oracle.jdbc.driver.OracleDriver
    For the Connection URL :jdbc:oracle:thin:@IPAddress:1521:DBNAME
    Marc Prud'hommeaux
    SolarMetric Inc.

  • Reverse Mapping Tutorial - Finder.java queries the wrong table?!

    I have been almost successful in running the Reverse Mapping Tutorial, by
    creating Java Classes from the hsqldb sample database, and running the JDO
    Enhancer on them.
    However, I cannot get he Finder.java to work. It seems to look in the wrong
    table: MAGAZINEX instead of MAGAZINE?
    Did anyone have trouble with this step, or ran it successfully?
    Liviu
    PS: here is the trace:
    0 [main] INFO kodo.Runtime - Starting Kodo JDO version 2.4.2
    (kodojdo-2.4.2-20030326-1841) with capabilities: [Enterprise Edition
    Features, Standard Edition Features, Lite Edition Features, Evaluation
    License, Query Extensions, Datacache Plug-in, Statement Batching, Global
    Transactions, Developer Tools, Custom Database Dictionaries, Enterprise
    Databases]
    70 [main] WARN kodo.Runtime - WARNING: Kodo JDO Evaluation expires in 25
    days. Please contact [email protected] for information on extending your
    evaluation period or purchasing a license.
    68398 [main] INFO kodo.MetaData -
    com.solarmetric.kodo.meta.JDOMetaDataParser@19eda2c: parsing source:
    file:/C:/Documents%20and%20Settings/default/jbproject/JDO/classes/reversetut
    orial.jdo
    74577 [main] INFO jdbc.JDBC - [ C:24713456; T:31737213; D:22310332 ] open:
    jdbc:hsqldb:hsql_sample_database (sa)
    75689 [main] INFO jdbc.JDBC - [ C:24713456; T:31737213; D:22310332 ] close:
    com.solarmetric.datasource.PoolConnection@17918f0[[requests=0;size=0;max=70;
    hits=0;created=0;redundant=0;overflow=0;new=0;leaked=0;unavailable=0]]
    75699 [main] INFO jdbc.JDBC - [ C:24713456; T:31737213; D:22310332 ] close
    connection
    77331 [main] INFO jdbc.JDBC - Using dictionary class
    "com.solarmetric.kodo.impl.jdbc.schema.dict.HSQLDictionary" to connect to
    "HSQL Database Engine" (version "1.7.0") with JDBC driver "HSQL Database
    Engine Driver" (version "1.7.0")
    1163173 [main] INFO jdbc.JDBC - [ C:3093871; T:31737213; D:22310332 ] open:
    jdbc:hsqldb:hsql_sample_database (sa)
    1163293 [main] INFO jdbc.SQL - [ C:3093871; T:31737213; D:22310332 ]
    preparing statement <17940412>: SELECT DISTINCT MAGAZINEX.JDOCLASSX FROM
    MAGAZINEX
    1163313 [main] INFO jdbc.SQL - [ C:3093871; T:31737213; D:22310332 ]
    executing statement <17940412>: [reused=1;params={}]
    1163443 [main] INFO jdbc.JDBC - [ C:3093871; T:31737213; D:22310332 ]
    close:
    com.solarmetric.datasource.PoolConnection@2f356f[[requests=1;size=0;max=70;h
    its=0;created=1;redundant=0;overflow=0;new=1;leaked=0;unavailable=0]]
    1163443 [main] INFO jdbc.JDBC - [ C:3093871; T:31737213; D:22310332 ] close
    connection
    Hit uncaught exception javax.jdo.JDOFatalDataStoreException
    javax.jdo.JDOFatalDataStoreException:
    com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper:
    [SQL=SELECT DISTINCT MAGAZINEX.JDOCLASSX FROM MAGAZINEX]
    [PRE=SELECT DISTINCT MAGAZINEX.JDOCLASSX FROM MAGAZINEX]
    Table not found: S0002 Table not found: MAGAZINEX in statement [SELECT
    DISTINCT MAGAZINEX.JDOCLASSX FROM MAGAZINEX] [code=-22;state=S0002]
    NestedThrowables:
    com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper:
    [SQL=SELECT DISTINCT MAGAZINEX.JDOCLASSX FROM MAGAZINEX]
    [PRE=SELECT DISTINCT MAGAZINEX.JDOCLASSX FROM MAGAZINEX]
    Table not found: S0002 Table not found: MAGAZINEX in statement [SELECT
    DISTINCT MAGAZINEX.JDOCLASSX FROM MAGAZINEX]
    at
    com.solarmetric.kodo.impl.jdbc.runtime.SQLExceptions.throwFatal(SQLException
    s.java:17)
    at
    com.solarmetric.kodo.impl.jdbc.ormapping.SubclassProviderImpl.getSubclasses(
    SubclassProviderImpl.java:283)
    at
    com.solarmetric.kodo.impl.jdbc.ormapping.ClassMapping.getPrimaryMappingField
    s(ClassMapping.java:1093)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.executeQuery(JDBCSto
    reManager.java:704)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCQuery.executeQuery(JDBCQuery.java
    :93)
    at com.solarmetric.kodo.query.QueryImpl.executeWithMap(QueryImpl.java:792)
    at com.solarmetric.kodo.query.QueryImpl.execute(QueryImpl.java:595)
    at reversetutorial.Finder.main(Finder.java:32)
    NestedThrowablesStackTrace:
    java.sql.SQLException: Table not found: S0002 Table not found: MAGAZINEX in
    statement [SELECT DISTINCT MAGAZINEX.JDOCLASSX FROM MAGAZINEX]
    at org.hsqldb.Trace.getError(Trace.java:226)
    at org.hsqldb.jdbcResultSet.<init>(jdbcResultSet.java:6595)
    at org.hsqldb.jdbcConnection.executeStandalone(jdbcConnection.java:2951)
    at org.hsqldb.jdbcConnection.execute(jdbcConnection.java:2540)
    at org.hsqldb.jdbcStatement.fetchResult(jdbcStatement.java:1804)
    at org.hsqldb.jdbcStatement.executeQuery(jdbcStatement.java:199)
    at
    org.hsqldb.jdbcPreparedStatement.executeQuery(jdbcPreparedStatement.java:391
    at
    com.solarmetric.datasource.PreparedStatementWrapper.executeQuery(PreparedSta
    tementWrapper.java:93)
    at
    com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executePreparedQueryI
    nternal(SQLExecutionManagerImpl.java:771)
    at
    com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executeQueryInternal(
    SQLExecutionManagerImpl.java:691)
    at
    com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executeQuery(SQLExecu
    tionManagerImpl.java:372)
    at
    com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executeQuery(SQLExecu
    tionManagerImpl.java:356)
    at
    com.solarmetric.kodo.impl.jdbc.ormapping.SubclassProviderImpl.getSubclasses(
    SubclassProviderImpl.java:246)
    at
    com.solarmetric.kodo.impl.jdbc.ormapping.ClassMapping.getPrimaryMappingField
    s(ClassMapping.java:1093)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.executeQuery(JDBCSto
    reManager.java:704)
    at
    com.solarmetric.kodo.impl.jdbc.runtime.JDBCQuery.executeQuery(JDBCQuery.java
    :93)
    at com.solarmetric.kodo.query.QueryImpl.executeWithMap(QueryImpl.java:792)
    at com.solarmetric.kodo.query.QueryImpl.execute(QueryImpl.java:595)
    at reversetutorial.Finder.main(Finder.java:32)

    The reason I did not run importtool is because ... I actually ran it, but it
    was not successfull. **!
    I now tried the solutions directory, from the kodo distribution, and that
    failed as well. Here is what I did:
    - I went to reversetutorial/solutions, and compiled all the classes, and
    then placed them into a reversetutorial folder (to match the package)
    - ran "rd-importtool reversetutorial.mapping" (the mapping file from the
    solutions directory), which failed as below:
    0 [main] INFO kodo.MetaData - Parsing metadata resource
    "file:/C:/kodo/reversetutorial/solutions/reversetutorial.mapping".
    Exception in thread "main"
    com.solarmetric.rd.kodo.meta.JDOMetaDataNotFoundException: No JDO metadata
    was found for type "class reversetutorial.Article".
    FailedObject:class reversetutorial.Article
    at
    com.solarmetric.rd.kodo.meta.JDOMetaDataRepositoryImpl.getMetaData(JDOMetaDa
    taRepositoryImpl.java:148)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.MappingRepository.getMetaData(Mapping
    Repository.java:147)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.MappingRepository.getMapping(MappingR
    epository.java:158)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.compat.ImportTool.getMapping(ImportTo
    ol.java:126)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.compat.ImportTool.importMappings(Impo
    rtTool.java:57)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.compat.ImportTool.run(ImportTool.java
    :408)
    at
    com.solarmetric.rd.kodo.impl.jdbc.meta.compat.ImportTool.main(ImportTool.jav
    a:385)
    Any idea why? The solutions directory should work, right? I even tried
    specifying a kodo.properties file, but it did not seem to help.
    Liviu
    "Abe White" <[email protected]> wrote in message
    news:[email protected]...
    Running the reversemappingtool creates classes, metadata files, and a
    .mapping file. That .mapping file contains all the O/R mapping
    information for how the generated classes map to your existing database
    tables. What the importtool does is just transfer that mapping
    information to the metadata files, in the form of <extension> elements.
    The reason this is a separate step will be clear once Kodo 3.0 comes out.
    So in sum, the importtool does not affect the database in any way. It
    just moves information from one format (.mapping file) to another
    (<extension> elements in the .jdo file).

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

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

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

  • Please help - Dreamweaver Image Map Tool/Outlook for Mac

    Hello:
    I was wondering if you could help me navigate through an issue I am having with the image map tool.  I have created a design file is PSD, saved it as a JPG, then transferred it into Dreamweaver to link the design to a web page.  However, I would like to embed different links within one HTML file to e-mail out, so I used the image map tool to do so.  However, when I copy/paste the completed HTML into an Outlook for Mac message (Command A; Command C; Command V), the image map/additional links do not transfer over once the file is pasted in an e-mail.  I also tested this with G-mail and the Apple E-mail app, and was not successful.  Please help.

    You can't paste images into e-mails.  Use absolute links to images hosted on your domain server like this:
    <img src="http://yourdomain.com/images/your_map.jpg">
    See HTML E-mails: what you need to know
    http://alt-web.com/Articles/HTML-Emails.shtml
    Nancy O.

  • Which object-relational mapping tool is the best for Oracle Coherence?

    Which object-relational mapping tool is the best for Oracle Coherence?
    My application is read-and-write-intensive. Which tool is most suitable for this application?
    TopLink essentials, TopLink, Eclipse or Hibernate?
    Thank you

    I would pick Hibernate mainly because of its popularity and wide knowledge base.
    Coherence has provided some documentation for the integration.
    http://download.oracle.com/docs/cd/E14526_01/coh.350/e14537/usehibernateascoh.htm#CEGFEFJH
    If you have the schema in database, myEclipse can provide you hibernate bindings by reverse engineering.

  • Mapping Tool foreign keys

    <field name="employee">
    <extension vendor-name="kodo" key="jdbc-field-map"
    value="one-one">
    <extension vendor-name="kodo" key="column.ID" value="EMPLOYEE_ID"/>
    </extension>
    </field>
    Hello all,
    If I have the above field defined for one my classes in package.jdo,
    should the mapping tools create the foreign keys automatically?
    Thanks.

    Hi Marc,
    Thanks for the reply.
    I tried using null and cascade for the value of the jdbc-delete-action. I
    also added the property kodo.jdbc.ForeignKeyConstraints: true to
    kodo.properties. In all cases the foreign key is showing up in the
    schema, but not getting inserted into the database, MySQL with jdbc
    driver version 3.0.15ga.
    A more worrying issue to me is that fact that the joins are not showing up
    in the schema. From what I understood from section 7.5.1 of the
    documentation the one-one jdbc-field-map extension should add the joins.
    My code still works I am just a little miffed as to why the joins are not
    showing up. They do not show up for other types of jdbc-field-map, for
    collections, as I would expect.
    I'm pasting below the meta-data for the class in question plus the portion
    of the schema.xml for that class. (If you need the full schema.xml and
    meta-data please supply an email address I can send it to, as I do not
    want to post this information on an open forum).
    I'm also posting below the output of the mapping tool. Please tell me if
    there is anything else you need.
    Cheers.
    <class name="TripImpJdo"
    persistence-capable-superclass="trekwatch.core.security.AbstractPolicedObject"
    objectid-class="TripImpJdoId">
    <extension vendor-name="kodo" key="data-cache-timeout"
    value="-1"/>
    <extension vendor-name="kodo" key="jdbc-class-ind"
    value="in-class-name">
    <extension vendor-name="kodo" key="column"
    value="JDOCLASS"/>
    </extension>
    <extension vendor-name="kodo" key="jdbc-class-map"
    value="base">
    <extension vendor-name="kodo" key="table"
    value="tripimpjdo"/>
    </extension>
    <extension vendor-name="kodo" key="jdbc-field-mappings">
    <extension vendor-name="kodo"
    key="trekwatch.core.TWObject.authorId">
    <extension vendor-name="kodo" key="jdbc-field-map"
    value="value">
    <extension vendor-name="kodo" key="column"
    value="AUTHORID"/>
    </extension>
    </extension>
    <extension vendor-name="kodo"
    key="trekwatch.core.TWObject.id">
    <extension vendor-name="kodo" key="jdbc-field-map"
    value="value">
    <extension vendor-name="kodo" key="column"
    value="ID"/>
    </extension>
    </extension>
    <extension vendor-name="kodo"
    key="trekwatch.core.TWObject.timeStamp">
    <extension vendor-name="kodo" key="jdbc-field-map"
    value="value">
    <extension vendor-name="kodo" key="column"
    value="TIMESTAMP0"/>
    </extension>
    </extension>
    <extension vendor-name="kodo"
    key="trekwatch.core.security.AbstractPolicedObject.copyPolicy">
    <extension vendor-name="kodo" key="jdbc-field-map"
    value="pc">
    <extension vendor-name="kodo" key="column"
    value="COPYPOLICY"/>
    </extension>
    </extension>
    <extension vendor-name="kodo"
    key="trekwatch.core.security.AbstractSecureTWObject.acl">
    <extension vendor-name="kodo" key="jdbc-field-map"
    value="pc">
    <extension vendor-name="kodo" key="column"
    value="ACL"/>
    </extension>
    </extension>
    </extension>
    <extension vendor-name="kodo" key="jdbc-version-ind"
    value="version-number">
    <extension vendor-name="kodo" key="column"
    value="JDOVERSION"/>
    </extension>
    <field name="activities">
    <collection
    element-type="trekwatch.core.activity.ActivityImpJdo"/>
    <extension vendor-name="kodo" key="jdbc-field-map"
    value="many-many">
    <extension vendor-name="kodo" key="element-column.ID"
    value="ACTIVITIES_ID"/>
    <extension vendor-name="kodo" key="order-column"
    value="ACTIVITIES_ORDER"/>
    <extension vendor-name="kodo" key="ref-column.ID"
    value="ID"/>
    <extension vendor-name="kodo" key="table"
    value="tripi_activities"/>
    </extension>
    </field>
    <field name="atomSignature" persistence-modifier="persistent">
    <extension vendor-name="kodo" key="jdbc-field-map"
    value="pc">
    <extension vendor-name="kodo" key="column"
    value="ATOMSIGNATURE"/>
    </extension>
    </field>
    <field name="budget">
    <extension vendor-name="kodo" key="jdbc-field-map"
    value="value">
    <extension vendor-name="kodo" key="column"
    value="BUDGET"/>
    </extension>
    </field>
    <field name="budgetType">
    <extension vendor-name="kodo" key="jdbc-field-map"
    value="value">
    <extension vendor-name="kodo" key="column"
    value="BUDGETTYPE"/>
    </extension>
    </field>
    <field name="description">
    <extension vendor-name="kodo" key="jdbc-field-map"
    value="value">
    <extension vendor-name="kodo" key="column"
    value="DESCRIPTION"/>
    </extension>
    </field>
    <field name="endDate">
    <extension vendor-name="kodo" key="jdbc-field-map"
    value="value">
    <extension vendor-name="kodo" key="column"
    value="ENDDATE"/>
    </extension>
    </field>
    <field name="gearList">
    <extension vendor-name="kodo" key="jdbc-delete-action"
    value="null"/>
    <extension vendor-name="kodo" key="jdbc-field-map"
    value="one-one">
    <extension vendor-name="kodo" key="column.ID"
    value="GEARLIST_ID"/>
    </extension>
    </field>
    <field name="name">
    <extension vendor-name="kodo" key="jdbc-field-map"
    value="value">
    <extension vendor-name="kodo" key="column"
    value="NAME0"/>
    </extension>
    </field>
    <field name="numDays">
    <extension vendor-name="kodo" key="jdbc-field-map"
    value="value">
    <extension vendor-name="kodo" key="column"
    value="NUMDAYS"/>
    </extension>
    </field>
    <field name="startDate">
    <extension vendor-name="kodo" key="jdbc-field-map"
    value="value">
    <extension vendor-name="kodo" key="column"
    value="STARTDATE"/>
    </extension>
    </field>
    <field name="timeAvailable">
    <extension vendor-name="kodo" key="jdbc-field-map"
    value="value">
    <extension vendor-name="kodo" key="column"
    value="TIMEAVAILABLE"/>
    </extension>
    </field>
    <field name="todoList">
    <extension vendor-name="kodo" key="jdbc-field-map"
    value="one-one">
    <extension vendor-name="kodo" key="column.ID"
    value="TODOLIST_ID"/>
    </extension>
    </field>
    <field name="tripElements">
    <collection element-type="TripElement"/>
    <extension vendor-name="kodo" key="jdbc-field-map"
    value="pc-collection">
    <extension vendor-name="kodo" key="element-column"
    value="ELEMENT"/>
    <extension vendor-name="kodo" key="order-column"
    value="TRIPELEMENTS_ORDER"/>
    <extension vendor-name="kodo" key="ref-column.ID"
    value="ID"/>
    <extension vendor-name="kodo" key="table"
    value="tripi_tripelements"/>
    </extension>
    </field>
    </class>
    <table name="tripimpjdo">
    <pk column="ID"/>
    <column name="ACL" type="varchar" size="255"/>
    <column name="ATOMSIGNATURE" type="varchar" size="255"/>
    <column name="AUTHORID" type="varchar" size="255"/>
    <column name="BUDGET" type="integer"/>
    <column name="BUDGETTYPE" type="integer"/>
    <column name="COPYPOLICY" type="varchar" size="255"/>
    <column name="DESCRIPTION" type="varchar" size="255"/>
    <column name="ENDDATE" type="timestamp"/>
    <column name="GEARLIST_ID" type="bigint"/>
    <column name="ID" type="bigint" not-null="true"/>
    <column name="JDOCLASS" type="varchar" size="255"/>
    <column name="JDOVERSION" type="integer"/>
    <column name="NAME0" type="varchar" size="255"/>
    <column name="NUMDAYS" type="integer"/>
    <column name="STARTDATE" type="timestamp"/>
    <column name="TIMEAVAILABLE" type="integer"/>
    <column name="TIMESTAMP0" type="timestamp"/>
    <column name="TODOLIST_ID" type="bigint"/>
    <fk delete-action="cascade" to-table="gearitemlist"
    column="GEARLIST_ID"/>
    <fk to-table="todolist" column="TODOLIST_ID"/>
    <index name="I_TRPMPJD_GEARLIST_ID" column="GEARLIST_ID"/>
    <index name="I_TRPMPJD_JDOCLASS" column="JDOCLASS"/>
    <index name="I_TRPMPJD_JDOVERSION" column="JDOVERSION"/>
    <index name="I_TRPMPJD_TODOLIST_ID" column="TODOLIST_ID"/>
    </table>
    create-schema:
    [echo]
    ================================================================
    [echo] Refreshing the schema in the data store
    [echo]
    ================================================================
    [mappingtool] 625 INFO [main] kodo.Tool - Mapping tool running on type
    "class ***" with action "refresh".
    [mappingtool] 1891 INFO [main] kodo.Tool - Mapping tool running on type
    "class ***" with action "refresh".
    [mappingtool] 1906 INFO [main] kodo.Tool - Mapping tool running on type
    "class ***" with action "refresh".
    (many more of the same as above for each persistent class.
    [mappingtool] 2250 INFO [main] kodo.Tool - Recording mapping and schema
    changes.
    [mappingtool] 5063 WARN [main] kodo.jdbc.Schema - The foreign key
    "F_TRPMPJD_GEARLIST" was not added to table "TRIPIMPJDO".
    build:
    BUILD SUCCESSFUL
    Total time: 20 seconds
    Marc Prud'hommeaux wrote:
    Goerge-
    As well as adding the jdbc-delete-action, you also want to set the
    following in your kodo.properties:
    kodo.jdbc.ForeignKeyConstraints: true
    Also, I notice you are using MySQL: MySQL doesn't support some foreign
    keys (such as deferred constraints). Is your foreign key deferred? Can
    you post the schema.xml file, as well as the complete output from the
    mappingtool so we can take a look at it?
    In article <[email protected]>, Goerge wrote:
    UPDATE again:
    This dialog with myself is actually not bad.
    Anyway, I've made some head way:
    After reading through 16 pages of posts here, I found one with the same
    problem I had, where it stated that foreign key constraints are not added
    to the database unless a jdbc-delete-action extension is used.
    After adding the following extension to the field in question, I still do
    not get the foreign key in the database, but at least I get the following
    message when running the mapping tool:
    [mappingtool] 6157 WARN [main] kodo.jdbc.Schema - The foreign key
    "F_TRPMPJD_GEARLIST" was not added to table "TRIPIMPJDO".
    I am using MySQL with innodb tables, so foreign keys should be supported.
    Is there another reason they are not being added?
    Thanks again.
    Marc Prud'hommeaux
    SolarMetric Inc.

  • Apple SMTP server IP not reverse mapped

    I have discovered that the SMTP server that Apple is using to reply my outgoing iCloud email (17.111.211.51) does not have a valid reverse hostname associated with it. This causes some of my email to be rejected by other mail servers. I do know that some of Apple SMTP servers are correctly reverse mapped,. but not this particular one.
    i.e.
    host 17.172.220.237
    237.220.172.17.in-addr.arpa domain name pointer st11p02mm-asmtp002.mac.com.
    237.220.172.17.in-addr.arpa domain name pointer st11p02mm-asmtpout002.mac.com.
    This seems to be an oversight bt Apple's network administarators. I'm hoping that this message can be forwarded to the appropriate dept.
    Thanks!

    F.D.E. Schleiermacher wrote:
    Hello.
    I'm hoping someone can help with a problem I've been having today.
    I have a Gmail account which I use on my Mac (MacBook Pro, 2.4GHz Intel Core 2 Duo, System 10.6.8), my iPad and my ancient iPhone. Everything has worked perfectly for the last two years until today when it stopped sending e-mail from any device. On my iPad, it tells me that the SMTP server 'does not allow relay'. On my MacBook, it simply refuses to send it and prompts me to choose another SMTP server (which, alas, I don't have).
    At any rate, here is a list of things I've already tried:
    1. I tried switching my computer off and on again. This didn't work.
    2. I have deleted the account (from both Mac and iPad) and set it up again. This didn't work.
    3. I have deleted just the SMTP server details and re-entered them (both Mac and iPad). This also didn't work.
    4. I manually changed the SMTP port to 25 and 587. This didn't work.
    5. I have tried to send e-mail from a different WiFi network and from 3G (Mac, iPad and iPhone). This didn't work.
    6. I have tried setting up a completely new Gmail account and using the SMTP server of that account to send messages. Bizarrely, this sort of worked: it allowed me to send a message, but the message showed up from the new account rather than from my primary account. However this is not an ideal solution. I would much prefer having a single e-mail account which both sends and receives.
    7. I also tried a variety of other things, but nothing worked.
    I fear the problem may actually be with Gmail, and not with any of the Apple products in question. I spent about an hour trying to contact Google, but I don't think they will get back to me.
    If anyone has any brilliant ideas, I would be tremendously grateful.
    All the best.
    The issue is with gmail.  There are 10 post already about this in the iphone forum.

  • Bug in exists() function of XI Graphical Mapping Tool?

    Hi!
    If I connect a source field with the exists() function in XI Graphical Mapping Tool and the tag exists it returns TRUE, otherwise it returns FALSE, so everything works as expected.
    But I have to connect a user-defined function with exists(). The user-defined function will either calculate a value or set Resultset.SUPPRESS.
    If there is a value the exits() function returns TRUE, however if Resultset.SUPPRESS is set it does also return TRUE! This looks to me like a bug in exists() function. Shouldn't it always return FALSE if the input is Resultset.SUPPRESS?
    Regards, Tanja

    Hi Stefan!
    > The exists() function checks, if a queue is empty.
    > An empty queue is <b>not</b> represented by the
    > SUPPRESS value.
    > If inside a queue there is a SUPPRESS value, the
    > queue is <b>not</b> empty.
    Ok, so it's not a bug and the exists() function is working as expected.
    > If you want the exist() function after a UDF, provide
    > an empty queue, or easier: return the values "true"
    > or "false" directly from the UDF.
    Yes, that's how I actually solved the problem. The UDF was used at several places where the ResultList.SUPPRESS output was needed. So I copied the UDF and changed it so that the output was TRUE or FALSE instead.
    Regards, Tanja

  • Mapping tool creates new columns one at a time

    Hi All,
    I'm using Kodo 3.2.2 with MySql 4.1. I have a fairly large table (over
    2million rows) representing one persistent class. I need to add several
    new fields to the object, which will require a refresh mapping on the
    database to add new columns for the fields.
    It seems when I run refresh mapping on the database, Kodo is adding each
    new field individually in seperate ALTER TABLE statements, rather than
    adding all the columns in one ALTER TABLE statement.
    With MySQL and large tables, this can really increase the time required to
    refresh the mapping - I've tried with MSSQL and that database must handle
    ALTER TABLE commands differently because it doesn't take a fraction of the
    time that MySQL takes.
    Is this a bug (I doubt it), but rather a feature improvement?
    Thoughts?
    Thanks,
    Brendan

    Thanks Abe for the reply - I've been meaning to look at the process of
    creating SQL scripts to perform the refresh mappings on our databases.
    I'll have a look at this process before we talk contracting!
    Thanks,
    Brendan
    Abe White wrote:
    Unfortunately, we don't have any immediate plans to optimize ALTER TABLEsince
    it's not a runtime operation, and as you say most DBs don't have a problemwith
    it. Also, note that the documentation shows how to get Kodo to create SQL
    scripts rather than directly modify the DB; you could easily edit thescripts
    Kodo generates to make them more efficient before piping the SQL to MySQLusing
    its client app. (Note that Kodo 3.3 introduces the ability to generate SQL
    scripts directly from the mapping tool, rather than having to take an extrastep
    through the schema tool).
    If getting Kodo to combine ALTER statements is important to you, you couldalso
    contact [email protected] about contracting us to expedite this work.

  • HU error when Reversing the goods issue in STO process

    Hello Gurus,
    I will explain the whole process we follow for STO:
    1. Create sales order ->Based on PR in sales order schedule lines, PO will be created -> outbound delivery -> Pack in HU -> PGI -> based on output type Idoc will be triggered -> this outbound IDOC will create the Inbound IDOC and Inbound delivery -> Here HU will copied from Outbound delivery (Means both in inbound delivery and outbound delivery HU is same)-> then do the Good receipt in Inbound delivery.
    Now when user doing the goods receipt he is getting error MSSA-SATRA exceeded by 1PCE  The reason is someone deleted the item from the sales order.  Hence when user trying to post the GR it is checking for the open sales order item in MSSA table.  Since it has been deleted from the sales order he cant able post GR.
    Now user does not wants to receive this item, hence we wants to reverse the process.
    So we followed the below process:
    1. Unassigned the HU in Inbound delivery and then deleted the Inbound delivery.
    2. Then used VL09 transaction to reverse the goods issue.  But system giving error saying that HU is already assigned to object.
    I cant able to reverse the Goods issue since the HU is same in Inbound delivery and outbound delivery.
    Kindly suggest the reversal process for the above case.  Many thanks for your help in advance.
    Awating for your valuable replies.
    Br,

    Insted of deleting the handling units you should have un assign the handling units from inbound delivery.You have deleted the handling units and the same handling units will not be available in outbound delivery Pack icon.
    Do one thing are you able to enter line item in sales order ?.If yes then create inbound delivery manually and create new handling units for the qty and do GR.
    Currently where is the stock is it transit ?.If yes then above option may work.
    If nothing is possible only an option to write a SAP oss note they will correct your outbound delivery and inbound delivery.

Maybe you are looking for

  • BSOD on boot due to Lenovo Power Manager

    I was uninstalling this Power Manager last time on computer. I do not remember what version it was. It was stuck at 94% for long time (half hour), so I shutdown my computer instead of waiting for it. Now my windows 7 cannot boot at all. Not even safe

  • Reinstall windows

    i reinstall my wondows and itunes but now when i want to be connect to my ipad ask me if i sync will remove all the information i installed already on it .culd some one help me in this regards,i already copied all the foldar i prevousely had for itun

  • How do I move from Mozilla Thunderbird to Apple Mail for email??

    Hi, I am currently using Thunderbird from Mozilla & I would like to use Apple's Mail application for sending and receiving my email. I tried to import Thunderbird but it did not work. I would also like to import the subfolders where I saved email mes

  • OBIEE Permissions to particular SubjectAreas

    Hi All, We are using OBIEE10.1.3.4 version.Actually our requriment is we have lot of users are there in this some of users are belongs to particulat subject areas we need to give access to particular "Subject Areas" to the users .In My project we hav

  • Empty tool panels

    I'm running CS4 on an OSX 10.6.4 equipped 17" Mac Book Pro (Circa 2007). Lately, while working in PS, InD, or Ai, my tool panels will occasionally show up empty. (See attached) It's most annoying when you're in the throws of a looming deadline... I'v