You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@empire-db.apache.org by "McKinley (JIRA)" <em...@incubator.apache.org> on 2010/01/08 17:00:57 UTC

[jira] Created: (EMPIREDB-69) Codegen Many Table Patterns, Template Folder in Config, and many more

Codegen Many Table Patterns, Template Folder in Config, and many more
---------------------------------------------------------------------

                 Key: EMPIREDB-69
                 URL: https://issues.apache.org/jira/browse/EMPIREDB-69
             Project: Empire-DB
          Issue Type: New Feature
          Components: CodeGenerator
    Affects Versions: empire-db-2.0.7-incubating 
            Reporter: McKinley
             Fix For: empire-db-2.0.7-incubating 


I have various improvements to the codegen to give as a patch. I will attach the files here if possible.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (EMPIREDB-69) Codegen Many Table Patterns, Template Folder in Config, and many more

Posted by "McKinley (JIRA)" <em...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/EMPIREDB-69?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

McKinley updated EMPIREDB-69:
-----------------------------

    Attachment: empire-db-codegen.patch

This also includes a bug fix for DBRecord method name conflicts.

> Codegen Many Table Patterns, Template Folder in Config, and many more
> ---------------------------------------------------------------------
>
>                 Key: EMPIREDB-69
>                 URL: https://issues.apache.org/jira/browse/EMPIREDB-69
>             Project: Empire-DB
>          Issue Type: New Feature
>          Components: CodeGenerator
>    Affects Versions: empire-db-2.0.7-incubating 
>            Reporter: McKinley
>             Fix For: empire-db-2.0.7-incubating 
>
>         Attachments: empire-db-codegen.patch
>
>
> I have various improvements to the codegen to give as a patch. I will attach the files here if possible.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (EMPIREDB-69) Codegen Many Table Patterns, Template Folder in Config, and many more

Posted by "Francis De Brabandere (JIRA)" <em...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/EMPIREDB-69?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Francis De Brabandere updated EMPIREDB-69:
------------------------------------------

    Affects Version/s:     (was: empire-db-2.0.7-incubating )
                       empire-db-2.0.6-incubating
        Fix Version/s:     (was: empire-db-2.0.7-incubating )
                       empire-db-2.0.6-incubating

> Codegen Many Table Patterns, Template Folder in Config, and many more
> ---------------------------------------------------------------------
>
>                 Key: EMPIREDB-69
>                 URL: https://issues.apache.org/jira/browse/EMPIREDB-69
>             Project: Empire-DB
>          Issue Type: New Feature
>          Components: CodeGenerator
>    Affects Versions: empire-db-2.0.6-incubating
>            Reporter: McKinley
>             Fix For: empire-db-2.0.6-incubating
>
>         Attachments: empire-db-codegen2.patch, empire-db-codegen3.patch
>
>
> I have various improvements to the codegen to give as a patch. I will attach the files here if possible.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (EMPIREDB-69) Codegen Many Table Patterns, Template Folder in Config, and many more

Posted by "McKinley (JIRA)" <em...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/EMPIREDB-69?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

McKinley updated EMPIREDB-69:
-----------------------------

    Attachment:     (was: empire-db-codegen.patch)

> Codegen Many Table Patterns, Template Folder in Config, and many more
> ---------------------------------------------------------------------
>
>                 Key: EMPIREDB-69
>                 URL: https://issues.apache.org/jira/browse/EMPIREDB-69
>             Project: Empire-DB
>          Issue Type: New Feature
>          Components: CodeGenerator
>    Affects Versions: empire-db-2.0.7-incubating 
>            Reporter: McKinley
>             Fix For: empire-db-2.0.7-incubating 
>
>         Attachments: empire-db-codegen2.patch
>
>
> I have various improvements to the codegen to give as a patch. I will attach the files here if possible.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (EMPIREDB-69) Codegen Many Table Patterns, Template Folder in Config, and many more

Posted by "McKinley (JIRA)" <em...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/EMPIREDB-69?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

McKinley updated EMPIREDB-69:
-----------------------------

    Attachment: empire-db-codegen3.patch

One small patch for a null exception I found after I submitted the previous patch. Null from the config should probably be streamlined across all properties, but for now I have kept my patch for multiple table patterns consistent with the default value of null for tablePattern.

> Codegen Many Table Patterns, Template Folder in Config, and many more
> ---------------------------------------------------------------------
>
>                 Key: EMPIREDB-69
>                 URL: https://issues.apache.org/jira/browse/EMPIREDB-69
>             Project: Empire-DB
>          Issue Type: New Feature
>          Components: CodeGenerator
>    Affects Versions: empire-db-2.0.7-incubating 
>            Reporter: McKinley
>             Fix For: empire-db-2.0.7-incubating 
>
>         Attachments: empire-db-codegen2.patch, empire-db-codegen3.patch
>
>
> I have various improvements to the codegen to give as a patch. I will attach the files here if possible.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (EMPIREDB-69) Codegen Many Table Patterns, Template Folder in Config, and many more

Posted by "Francis De Brabandere (JIRA)" <em...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/EMPIREDB-69?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12799102#action_12799102 ] 

Francis De Brabandere commented on EMPIREDB-69:
-----------------------------------------------

empire-db-codegen3.patch applied

> Codegen Many Table Patterns, Template Folder in Config, and many more
> ---------------------------------------------------------------------
>
>                 Key: EMPIREDB-69
>                 URL: https://issues.apache.org/jira/browse/EMPIREDB-69
>             Project: Empire-DB
>          Issue Type: New Feature
>          Components: CodeGenerator
>    Affects Versions: empire-db-2.0.7-incubating 
>            Reporter: McKinley
>             Fix For: empire-db-2.0.7-incubating 
>
>         Attachments: empire-db-codegen2.patch, empire-db-codegen3.patch
>
>
> I have various improvements to the codegen to give as a patch. I will attach the files here if possible.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (EMPIREDB-69) Codegen Many Table Patterns, Template Folder in Config, and many more

Posted by "McKinley (JIRA)" <em...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/EMPIREDB-69?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12798049#action_12798049 ] 

McKinley edited comment on EMPIREDB-69 at 1/8/10 4:51 PM:
----------------------------------------------------------

I have found it necessary for my needs to use custom velocity
templates (I do not need a "C_" prefix on my column names for
example). In some cases, I need different templates for SQL Server and
MySQL. Therefore, being able to specify a template folder in the
config file is convenient. I have added that.

There is a bug in codegen where a column named "state" will conflict
with DBRecord.getState() or was it DBRecord.setState()? I added a
feature to compare each generated accessor and mutator name against
the method names of DBRecord. If there is a conflict, "Column" is
appended to the getter name and setter name to keep them consistent. I
would like someone to answer the question quoted at the bottom of this
email to let me know if the column name in the table class will need
to be named consistent to the getter and setter too.

In one of my databases, my table names are already camel case so I
added a check for that in the javaClassName method. If '_' and ' ' are
not present (some schemas can have ' ' in the name) then it will not
try and uppercase beyond the first character.

There is a little hack for MySQL default value on timestamp data type.
It may be a hack or it may be the right way to do it, but I think it
should go into codegen now and get pushed upstream later or kept in
codegen but surrounded by checks from supported features in the
Empire-db database drivers.

The best feature I have added here is support for AUTOINC in codegen.
My schemas use AUTOINC but this introduces and interesting problem for
codegen. Codegen will not create the right Java data type in the
Record class for the AUTOINC column if we change the type.  So, I use
an attribute to store the base data type (usually int, but could be
others) and made changes to read that data type during the creation of
the Record class.

      was (Author: mckinley1411):
    This also includes a bug fix for DBRecord method name conflicts.
  
> Codegen Many Table Patterns, Template Folder in Config, and many more
> ---------------------------------------------------------------------
>
>                 Key: EMPIREDB-69
>                 URL: https://issues.apache.org/jira/browse/EMPIREDB-69
>             Project: Empire-DB
>          Issue Type: New Feature
>          Components: CodeGenerator
>    Affects Versions: empire-db-2.0.7-incubating 
>            Reporter: McKinley
>             Fix For: empire-db-2.0.7-incubating 
>
>         Attachments: empire-db-codegen.patch
>
>
> I have various improvements to the codegen to give as a patch. I will attach the files here if possible.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (EMPIREDB-69) Codegen Many Table Patterns, Template Folder in Config, and many more

Posted by "Francis De Brabandere (JIRA)" <em...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/EMPIREDB-69?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Francis De Brabandere resolved EMPIREDB-69.
-------------------------------------------

    Resolution: Fixed

Closing this as we are releasing 2.0.6 and the codegen is implemented

> Codegen Many Table Patterns, Template Folder in Config, and many more
> ---------------------------------------------------------------------
>
>                 Key: EMPIREDB-69
>                 URL: https://issues.apache.org/jira/browse/EMPIREDB-69
>             Project: Empire-DB
>          Issue Type: New Feature
>          Components: CodeGenerator
>    Affects Versions: empire-db-2.0.6-incubating
>            Reporter: McKinley
>             Fix For: empire-db-2.0.6-incubating
>
>         Attachments: empire-db-codegen2.patch, empire-db-codegen3.patch
>
>
> I have various improvements to the codegen to give as a patch. I will attach the files here if possible.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (EMPIREDB-69) Codegen Many Table Patterns, Template Folder in Config, and many more

Posted by "Francis De Brabandere (JIRA)" <em...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/EMPIREDB-69?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12798601#action_12798601 ] 

Francis De Brabandere commented on EMPIREDB-69:
-----------------------------------------------

patch applied

> Codegen Many Table Patterns, Template Folder in Config, and many more
> ---------------------------------------------------------------------
>
>                 Key: EMPIREDB-69
>                 URL: https://issues.apache.org/jira/browse/EMPIREDB-69
>             Project: Empire-DB
>          Issue Type: New Feature
>          Components: CodeGenerator
>    Affects Versions: empire-db-2.0.7-incubating 
>            Reporter: McKinley
>             Fix For: empire-db-2.0.7-incubating 
>
>         Attachments: empire-db-codegen2.patch
>
>
> I have various improvements to the codegen to give as a patch. I will attach the files here if possible.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (EMPIREDB-69) Codegen Many Table Patterns, Template Folder in Config, and many more

Posted by "McKinley (JIRA)" <em...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/EMPIREDB-69?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

McKinley updated EMPIREDB-69:
-----------------------------

    Attachment: empire-db-codegen2.patch

This is patch is now synchronized with yesterday's changes in SVN.

> Codegen Many Table Patterns, Template Folder in Config, and many more
> ---------------------------------------------------------------------
>
>                 Key: EMPIREDB-69
>                 URL: https://issues.apache.org/jira/browse/EMPIREDB-69
>             Project: Empire-DB
>          Issue Type: New Feature
>          Components: CodeGenerator
>    Affects Versions: empire-db-2.0.7-incubating 
>            Reporter: McKinley
>             Fix For: empire-db-2.0.7-incubating 
>
>         Attachments: empire-db-codegen2.patch
>
>
> I have various improvements to the codegen to give as a patch. I will attach the files here if possible.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.