You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rave.apache.org by "marijan milicevic (Created) (JIRA)" <ji...@apache.org> on 2011/12/20 00:33:30 UTC

[jira] [Created] (RAVE-392) Use JPA instead of SQL statements for data initialization

Use JPA instead of SQL statements for data initialization
---------------------------------------------------------

                 Key: RAVE-392
                 URL: https://issues.apache.org/jira/browse/RAVE-392
             Project: Rave
          Issue Type: Improvement
    Affects Versions: 0.7-INCUBATING
            Reporter: marijan milicevic


please see attached patch and test case as an example. I think most of the data inserted is same to data inserted by init_data.sql file, except for the user layout (all users have same layout) 

Motivation:
- this should work on any database
- it is easier to maintain (for most part you have type safety, renaming, test cases if needed)
- it is easier to split/extend/modify by users

Problem: 
- in current setup it is not easy to use above initializing because data initializing/wiring  is done in rave-commons and above class depends on rave-core. I am not sure why rave-commons is not part of rave-core (as a subpackage) because it only contains handful of classes which are mostly used within rave-core itself and both of those dependencies are included as dependencies of other sub-projects



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (RAVE-392) Use JPA instead of SQL statements for data initialization

Posted by "Matt Franklin (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/RAVE-392?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13182497#comment-13182497 ] 

Matt Franklin commented on RAVE-392:
------------------------------------

I am still looking for the discussion from last year about why we didn't choose JPA to initialize the demo portal data.  The reasoning (as I remember it) was that the demo portal is just that, a demo; we didn't want to have a bunch of initialization code embedded in what people built real products on top of.  IMO, the SQL scripts work, but if you wanted to have actual code that intiialized the database, I think it should be dynamic (Groovy script, etc) or a completely separate sub-project that is added as a dependency to the demo portal only.

As for the second question, rave-commons is intended to be extremely generic code that could be used in many scenarios, not just Rave.  However, I do think the current organization needs some additional improvement (it was a good first step) and should change shortly.


                
> Use JPA instead of SQL statements for data initialization
> ---------------------------------------------------------
>
>                 Key: RAVE-392
>                 URL: https://issues.apache.org/jira/browse/RAVE-392
>             Project: Rave
>          Issue Type: Improvement
>    Affects Versions: 0.7-INCUBATING
>            Reporter: marijan milicevic
>         Attachments: jpa_data_initialization_.patch
>
>
> please see attached patch and test case as an example. I think most of the data inserted is same to data inserted by init_data.sql file, except for the user layout (all users have same layout) 
> Motivation:
> - this should work on any database
> - it is easier to maintain (for most part you have type safety, renaming, test cases if needed)
> - it is easier to split/extend/modify by users
> Problem: 
> - in current setup it is not easy to use above initializing because data initializing/wiring  is done in rave-commons and above class depends on rave-core. I am not sure why rave-commons is not part of rave-core (as a subpackage) because it only contains handful of classes which are mostly used within rave-core itself and both of those dependencies are included as dependencies of other sub-projects

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (RAVE-392) Use JPA instead of SQL statements for data initialization

Posted by "marijan milicevic (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/RAVE-392?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

marijan milicevic updated RAVE-392:
-----------------------------------

    Attachment: jpa_data_initialization_.patch

JPA data initialization
                
> Use JPA instead of SQL statements for data initialization
> ---------------------------------------------------------
>
>                 Key: RAVE-392
>                 URL: https://issues.apache.org/jira/browse/RAVE-392
>             Project: Rave
>          Issue Type: Improvement
>    Affects Versions: 0.7-INCUBATING
>            Reporter: marijan milicevic
>         Attachments: jpa_data_initialization_.patch
>
>
> please see attached patch and test case as an example. I think most of the data inserted is same to data inserted by init_data.sql file, except for the user layout (all users have same layout) 
> Motivation:
> - this should work on any database
> - it is easier to maintain (for most part you have type safety, renaming, test cases if needed)
> - it is easier to split/extend/modify by users
> Problem: 
> - in current setup it is not easy to use above initializing because data initializing/wiring  is done in rave-commons and above class depends on rave-core. I am not sure why rave-commons is not part of rave-core (as a subpackage) because it only contains handful of classes which are mostly used within rave-core itself and both of those dependencies are included as dependencies of other sub-projects

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (RAVE-392) Use JPA instead of SQL statements for data initialization

Posted by "marijan milicevic (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/RAVE-392?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13181988#comment-13181988 ] 

marijan milicevic commented on RAVE-392:
----------------------------------------

Hi Jesse,

thanks for your reply. I am curious about the reasons against it (maybe some digging on mailing list will help, I'll try that).

Could someone shed some light on my second question:

"I am not sure why rave-commons is not part of rave-core (as a subpackage) because it only contains handful of classes which are mostly used within rave-core itself and both of those dependencies are included as dependencies of other sub-projects "

btw: " both of those dependencies are included as dependencies of other sub-projects"
means:

they are never used separately, always combination of both.



                
> Use JPA instead of SQL statements for data initialization
> ---------------------------------------------------------
>
>                 Key: RAVE-392
>                 URL: https://issues.apache.org/jira/browse/RAVE-392
>             Project: Rave
>          Issue Type: Improvement
>    Affects Versions: 0.7-INCUBATING
>            Reporter: marijan milicevic
>         Attachments: jpa_data_initialization_.patch
>
>
> please see attached patch and test case as an example. I think most of the data inserted is same to data inserted by init_data.sql file, except for the user layout (all users have same layout) 
> Motivation:
> - this should work on any database
> - it is easier to maintain (for most part you have type safety, renaming, test cases if needed)
> - it is easier to split/extend/modify by users
> Problem: 
> - in current setup it is not easy to use above initializing because data initializing/wiring  is done in rave-commons and above class depends on rave-core. I am not sure why rave-commons is not part of rave-core (as a subpackage) because it only contains handful of classes which are mostly used within rave-core itself and both of those dependencies are included as dependencies of other sub-projects

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Closed] (RAVE-392) Use JPA instead of SQL statements for data initialization

Posted by "Matt Franklin (Closed) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/RAVE-392?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matt Franklin closed RAVE-392.
------------------------------

    Resolution: Won't Fix
    
> Use JPA instead of SQL statements for data initialization
> ---------------------------------------------------------
>
>                 Key: RAVE-392
>                 URL: https://issues.apache.org/jira/browse/RAVE-392
>             Project: Rave
>          Issue Type: Improvement
>    Affects Versions: 0.7-INCUBATING
>            Reporter: marijan milicevic
>         Attachments: jpa_data_initialization_.patch
>
>
> please see attached patch and test case as an example. I think most of the data inserted is same to data inserted by init_data.sql file, except for the user layout (all users have same layout) 
> Motivation:
> - this should work on any database
> - it is easier to maintain (for most part you have type safety, renaming, test cases if needed)
> - it is easier to split/extend/modify by users
> Problem: 
> - in current setup it is not easy to use above initializing because data initializing/wiring  is done in rave-commons and above class depends on rave-core. I am not sure why rave-commons is not part of rave-core (as a subpackage) because it only contains handful of classes which are mostly used within rave-core itself and both of those dependencies are included as dependencies of other sub-projects

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (RAVE-392) Use JPA instead of SQL statements for data initialization

Posted by "Jesse Ciancetta (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/RAVE-392?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13175572#comment-13175572 ] 

Jesse Ciancetta commented on RAVE-392:
--------------------------------------

Hmm -- I understand the benefits of being database agnostic and having the compiler to help catch any issues but I'm still not sure I'd want the initial data to be defined in Java code.  I think we'd talked about doing it this way early and had decided against it but I cant seem to find any of those conversations in the mailing list archives.

Anyone else recall any of those discussions?  Any one else have an opinion on this?
                
> Use JPA instead of SQL statements for data initialization
> ---------------------------------------------------------
>
>                 Key: RAVE-392
>                 URL: https://issues.apache.org/jira/browse/RAVE-392
>             Project: Rave
>          Issue Type: Improvement
>    Affects Versions: 0.7-INCUBATING
>            Reporter: marijan milicevic
>         Attachments: jpa_data_initialization_.patch
>
>
> please see attached patch and test case as an example. I think most of the data inserted is same to data inserted by init_data.sql file, except for the user layout (all users have same layout) 
> Motivation:
> - this should work on any database
> - it is easier to maintain (for most part you have type safety, renaming, test cases if needed)
> - it is easier to split/extend/modify by users
> Problem: 
> - in current setup it is not easy to use above initializing because data initializing/wiring  is done in rave-commons and above class depends on rave-core. I am not sure why rave-commons is not part of rave-core (as a subpackage) because it only contains handful of classes which are mostly used within rave-core itself and both of those dependencies are included as dependencies of other sub-projects

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (RAVE-392) Use JPA instead of SQL statements for data initialization

Posted by "marijan milicevic (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/RAVE-392?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13182523#comment-13182523 ] 

marijan milicevic commented on RAVE-392:
----------------------------------------

Hi Matt,

thx for answers, (and it makes sense.). 
please close this issue
                
> Use JPA instead of SQL statements for data initialization
> ---------------------------------------------------------
>
>                 Key: RAVE-392
>                 URL: https://issues.apache.org/jira/browse/RAVE-392
>             Project: Rave
>          Issue Type: Improvement
>    Affects Versions: 0.7-INCUBATING
>            Reporter: marijan milicevic
>         Attachments: jpa_data_initialization_.patch
>
>
> please see attached patch and test case as an example. I think most of the data inserted is same to data inserted by init_data.sql file, except for the user layout (all users have same layout) 
> Motivation:
> - this should work on any database
> - it is easier to maintain (for most part you have type safety, renaming, test cases if needed)
> - it is easier to split/extend/modify by users
> Problem: 
> - in current setup it is not easy to use above initializing because data initializing/wiring  is done in rave-commons and above class depends on rave-core. I am not sure why rave-commons is not part of rave-core (as a subpackage) because it only contains handful of classes which are mostly used within rave-core itself and both of those dependencies are included as dependencies of other sub-projects

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira