[ https://issues.apache.org/jira/browse/CAY-1946?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14116793#comment-14116793 ]
ASF GitHub Bot commented on CAY-1946: ------------------------------------- GitHub user AlexKolonitsky opened a pull request: https://github.com/apache/cayenne/pull/10 CAY-1946 cdbimport improvments Basic cdb import improvement: use db merge if model already exist 1) added DbLoaderConfiguration class; this class responsibility should be provide to DataLoader all necessary information 2) DbImportAction - this class will check availability of dataMap file and do merge if it is exist otherwise just load model from db 3) DbImportParameters - was renamed to DbImportConfiguration and also responsible fo construction of necessary objects for during import process 4) functional or end-to-end test for maven plugin basic usage scenarios 5) XmlUnit - for xml file comparison You can merge this pull request into a Git repository by running: $ git pull https://github.com/AlexKolonitsky/cayenne CAY-1946_cdbimport_improvments Alternatively you can review and apply these changes as the patch at: https://github.com/apache/cayenne/pull/10.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #10 ---- commit f40bdf45413941ec57e02052675d681fc3ff5e4d Author: alexkolonitsky <alex.kolonit...@gmail.com> Date: 2014-08-29T10:43:55Z CAY-1946 CDbimport improvements Basic cdb import improvement: use db merge if model already exist 1) added DbLoaderConfiguration class; this class responsibility should be provide to DataLoader all necessary information 2) DbImportAction - this class will check availability of dataMap file and do merge if it is exist otherwise just load model from db 3) DbImportParameters - was renamed to DbImportConfiguration and also responsible fo construction of necessary objects for during import process 4) functional or end-to-end test for maven plugin basic usage scenarios 5) XmlUnit - for xml file comparison commit 3519c22c602feaf0962a5ce6f14c1cd45cd4278d Author: alexkolonitsky <alex.kolonit...@gmail.com> Date: 2014-08-29T10:30:58Z CAY-1946 CDbimport improvements Basic cdb import improvement: use db merge if model already exist 1) added DbLoaderConfiguration class; this class responsibility should be provide to DataLoader all necessary information 2) DbImportAction - this class will check availability of dataMap file and do merge if it is exist otherwise just load model from db 3) DbImportParameters - was renamed to DbImportConfiguration and also responsible fo construction of necessary objects for during import process 4) functional or end-to-end test for maven plugin basic usage scenarios 5) XmlUnit - for xml file comparison (cherry picked from commit c2c7308) ---- > CDbimport improvements > ---------------------- > > Key: CAY-1946 > URL: https://issues.apache.org/jira/browse/CAY-1946 > Project: Cayenne > Issue Type: Improvement > Components: Non-GUI Tools > Reporter: Alex Kolonitsky > > We’ve experimented with automated db-first approach to Cayenne modeling for > more than a year on a set of client projects. Roughly this approach means > that DB evolution is managed via external tools (e.g. liquibase) and Cayenne > artifacts are managed using the following POM configuration: > <plugin> > <groupId>org.apache.cayenne.plugins</groupId> > <artifactId>maven-cayenne-plugin</artifactId> > <configuration> > ... > </configuration> > <executions> > <execution> > <id>default-cli</id> > <goals> > <goal>cdbimport</goal> > <goal>cgen</goal> > </goals> > </execution> > </executions> > </plugin> > “cdbimport” ensures that Cayenne model is always in sync with DB, “cgen” - > that Java classes are in sync with the model. There are zero problems with > “cgen", not so with “cdbimport". If you control the schema, you get a > decently named Java classes/properties in 95% of the cases. Here we are > trying to address the remaining 5% that make things ugly: > * Inability to generate meaningful relationship names in many cases. > * Inability to customize attribute/relationship names and data types. > To solve this here we are proposing a merge algorithm that would preserve > customizations to the Obj* layer made by the user. And in addition to that a > special descriptor that can be used for more advanced filtering and > customization of cdbimport process. Both of these improvements will hopefully > result in “cdbimport” becoming a tool of choice for Cayenne work for many > users. > https://docs.google.com/document/d/1DF5-_mMDCuH7iUFhEFDm2q-ebVeSPgvOaymho88ywJ0/edit?pli=1 -- This message was sent by Atlassian JIRA (v6.3.4#6332)