cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrus Adamchik (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CAY-1758) cdbimport improvements
Date Fri, 09 Nov 2012 15:14:12 GMT

     [ https://issues.apache.org/jira/browse/CAY-1758?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Andrus Adamchik updated CAY-1758:
---------------------------------

    Description: 
So I finally started using a DB-first (and hopefully ORM-modeling free) approach on a project.
In other words - a maven profile that executes cdbimport and cgen to refresh the XML and Java
classes from the current DB state. 3.1 version of 'cdbimport' is rather basic and we need
to extend it significantly to produce reliable and complete results. Here are a few things
that I want to see happen now. May open extra Jiras as I find other shortcomings. So...

* (done) Support for "catalog" parameter. In MySQL "databases" are "catalogs", not "schemas".
Currently I have to use DB URL that includes a catalog in it (jdbc:mysql://127.0.0.1/mydb),
and a null schema. Ideally I'd like to share a common URL in the parent pom for a set of databases
on the same server (jdbc:mysql://127.0.0.1/) , and distinguish between DBs by using "catalog"
parameter of the Maven plugin

* (done) Default adapter (if none specified) must be AutoAdapter, not JdbcAdapter. (Sort of
common sense, right?)

* Guess common driver names for the known DBs. This is sort of low priority, but we already
have adapter to driver mapping in the Modeler. Might take advantage of this here to cut down
on configs

* (done) Reverse engineer PK auto-increment status. Not even sure if JDBC allows that. Anyways
need to investigate

* Support for "defaultPackage" parameter, as the new DataMaps end up placing entities in the
"" package (which calls into question whether cdbimport has ever been used by anyone for anything
serious) 

* specified "schemaName" should become the default schema of the generated DataMap

* "overwrite" flag. Merging into existing entities is tricky and is never going to work reliably
if we expect the users to also edit the mapping by hand (in the Modeler). The current "overwriteExisting"
does not work as expected either. So I will deprecate (and make noop) "overwriteExisting"
flag, replacing it with a new "overwrite" flag that will literally create a new DataMap and
write it on top of the old one, not attempting to merge anything

* excludeTables/includeTables - these should work same way as the corresponding excludeEntities/includeEntities
in cgen. Current "tablePattern" is not adequate for filtering (but we'll still keep it around,
as it maps directly to the JDBC filtering mechanism)

* Noticed that DataMap "version" attribute is skipped when DM is saved by cdbimport:

@@ -2,7 +2,7 @@
 <data-map xmlns="http://cayenne.apache.org/schema/3.0/modelMap"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://cayenne.apache.org/schema/3.0/modelMap http://cayenne.apache.org/schema/3.0/modelMap.xsd"
-        project-version="6">
+       >

Need to align the format with the Modeler.





  was:
So I finally started using a DB-first (and hopefully ORM-modeling free) approach on a project.
In other words - a maven profile that executes cdbimport and cgen to refresh the XML and Java
classes from the current DB state. 3.1 version of 'cdbimport' is rather basic and we need
to extend it significantly to produce reliable and complete results. Here are a few things
that I want to see happen now. May open extra Jiras as I find other shortcomings. So...

* Support for "catalog" parameter. In MySQL "databases" are "catalogs", not "schemas". Currently
I have to use DB URL that includes a catalog in it (jdbc:mysql://127.0.0.1/mydb), and a null
schema. Ideally I'd like to share a common URL in the parent pom for a set of databases on
the same server (jdbc:mysql://127.0.0.1/) , and distinguish between DBs by using "catalog"
parameter of the Maven plugin

* Default adapter (if none specified) must be AutoAdapter, not JdbcAdapter. (Sort of common
sense, right?)

* Guess common driver names for the known DBs. This is sort of low priority, but we already
have adapter to driver mapping in the Modeler. Might take advantage of this here to cut down
on configs

* Reverse engineer PK auto-increment status. Not even sure if JDBC allows that. Anyways need
to investigate

* Support for "defaultPackage" parameter, as the new DataMaps end up placing entities in the
"" package (which calls into question whether cdbimport has ever been used by anyone for anything
serious) 

* specified "schemaName" should become the default schema of the generated DataMap

* "overwrite" flag. Merging into existing entities is tricky and is never going to work reliably
if we expect the users to also edit the mapping by hand (in the Modeler). The current "overwriteExisting"
does not work as expected either. So I will deprecate (and make noop) "overwriteExisting"
flag, replacing it with a new "overwrite" flag that will literally create a new DataMap and
write it on top of the old one, not attempting to merge anything

* excludeTables/includeTables - these should work same way as the corresponding excludeEntities/includeEntities
in cgen. Current "tablePattern" is not adequate for filtering (but we'll still keep it around,
as it maps directly to the JDBC filtering mechanism)

* Noticed that DataMap "version" attribute is skipped when DM is saved by cdbimport:

@@ -2,7 +2,7 @@
 <data-map xmlns="http://cayenne.apache.org/schema/3.0/modelMap"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://cayenne.apache.org/schema/3.0/modelMap http://cayenne.apache.org/schema/3.0/modelMap.xsd"
-        project-version="6">
+       >

Need to align the format with the Modeler.





    
> cdbimport improvements
> ----------------------
>
>                 Key: CAY-1758
>                 URL: https://issues.apache.org/jira/browse/CAY-1758
>             Project: Cayenne
>          Issue Type: Improvement
>          Components: Non-GUI Tools
>            Reporter: Andrus Adamchik
>            Assignee: Andrus Adamchik
>             Fix For: 3.2M1
>
>
> So I finally started using a DB-first (and hopefully ORM-modeling free) approach on a
project. In other words - a maven profile that executes cdbimport and cgen to refresh the
XML and Java classes from the current DB state. 3.1 version of 'cdbimport' is rather basic
and we need to extend it significantly to produce reliable and complete results. Here are
a few things that I want to see happen now. May open extra Jiras as I find other shortcomings.
So...
> * (done) Support for "catalog" parameter. In MySQL "databases" are "catalogs", not "schemas".
Currently I have to use DB URL that includes a catalog in it (jdbc:mysql://127.0.0.1/mydb),
and a null schema. Ideally I'd like to share a common URL in the parent pom for a set of databases
on the same server (jdbc:mysql://127.0.0.1/) , and distinguish between DBs by using "catalog"
parameter of the Maven plugin
> * (done) Default adapter (if none specified) must be AutoAdapter, not JdbcAdapter. (Sort
of common sense, right?)
> * Guess common driver names for the known DBs. This is sort of low priority, but we already
have adapter to driver mapping in the Modeler. Might take advantage of this here to cut down
on configs
> * (done) Reverse engineer PK auto-increment status. Not even sure if JDBC allows that.
Anyways need to investigate
> * Support for "defaultPackage" parameter, as the new DataMaps end up placing entities
in the "" package (which calls into question whether cdbimport has ever been used by anyone
for anything serious) 
> * specified "schemaName" should become the default schema of the generated DataMap
> * "overwrite" flag. Merging into existing entities is tricky and is never going to work
reliably if we expect the users to also edit the mapping by hand (in the Modeler). The current
"overwriteExisting" does not work as expected either. So I will deprecate (and make noop)
"overwriteExisting" flag, replacing it with a new "overwrite" flag that will literally create
a new DataMap and write it on top of the old one, not attempting to merge anything
> * excludeTables/includeTables - these should work same way as the corresponding excludeEntities/includeEntities
in cgen. Current "tablePattern" is not adequate for filtering (but we'll still keep it around,
as it maps directly to the JDBC filtering mechanism)
> * Noticed that DataMap "version" attribute is skipped when DM is saved by cdbimport:
> @@ -2,7 +2,7 @@
>  <data-map xmlns="http://cayenne.apache.org/schema/3.0/modelMap"
>          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>          xsi:schemaLocation="http://cayenne.apache.org/schema/3.0/modelMap http://cayenne.apache.org/schema/3.0/modelMap.xsd"
> -        project-version="6">
> +       >
> Need to align the format with the Modeler.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message