You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Andrus Adamchik (JIRA)" <ji...@apache.org> on 2012/11/09 16:56:13 UTC

[jira] [Comment Edited] (CAY-1758) cdbimport improvements

    [ https://issues.apache.org/jira/browse/CAY-1758?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13494068#comment-13494068 ] 

Andrus Adamchik edited comment on CAY-1758 at 11/9/12 3:55 PM:
---------------------------------------------------------------

@John: customizing native type mapping was on my list for another Jira. However this case was supposed to work. We have types.xml file for each adpater and SQLServer has this entry in it:

   <jdbc-type name="VARCHAR">
       <db-type name="varchar"/>
       <db-type name="nvarchar"/>
   </jdbc-type>

So I wonder why that didn't work.
                
      was (Author: andrus):
    @John: customizing native type mapping was on my list for another Jira. However in this case was supposed to work. We have types.xml file for each adpater and SQLServer has this entry in it:

   <jdbc-type name="VARCHAR">
       <db-type name="varchar"/>
       <db-type name="nvarchar"/>
   </jdbc-type>

So I wonder why that didn't work.
                  
> 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