[OS-JIRA] Created: (WOL-1150) Entity Modeler Does not Pick up Prototype Cascade for SQL Generation

From: Kieran Kelleher (JIRA) ("Kieran)
Date: Mon Mar 01 2010 - 11:06:08 EST

  • Next message: Kieran Kelleher: "Re: NPE when generating SQL [SOLVED]"

    Entity Modeler Does not Pick up Prototype Cascade for SQL Generation
    --------------------------------------------------------------------

                     Key: WOL-1150
                     URL: http://issues.objectstyle.org/jira/browse/WOL-1150
                 Project: WOProject/WOLips
              Issue Type: Bug
        Affects Versions: WOLips 3.5.x
             Environment: EntityModeler, WO 5.3.3, OS X 10.6, Eclipse 3.5, WOLips 3.5.6031
                Reporter: Kieran Kelleher

    ERXModel permits overriding and adding supplemental prototypes during runtime. EntityModeler dropdownlist of available prototypes and SQL generation needs to reflect the same override and supplemental logic.

    For example:
    If I have supplementary prototypes named "EOJDBCMySQLlistsourcePrototypes" in a model, and also selected as prototypes in the "Default" connection, EntityModeler will actually display a combination of these supplementary prototypes *AND* ERPrototypes (auto selected from the jdbc URL it seems). However SQL Generation will *only* use the *one* prototypes list selected in the Default connection. Thus NPE's will be thrown for prototypes that exist in ERPrototypes, but are missing in the supplementary protptypes. (NPE in Exhibit A below) This definitely does not seem like the correct behaviour? I would expect that SQL generation would draw from whatever list of prototypes that EntityModeler displays in the proto drop down list while building the EOModel.

    Workaround:
    If you want SQL generation, is not to add "additional supplementary" prototypes (even though ERXModel supports this at runtime), but just to copy the entire set of relevant prototypes from ERPrototypes, copy to your model (or wherever) and name the proto entity in such a way that ERXModel will prioritize it at runtime (see ERXModel javadoc). That seems to be the only way to have a EntityModeler drop down list that is consistent with SQL generation and runtime behaviour.

    Exhibit A (NPE):
    java.lang.RuntimeException: Failed to generate SQL.
            at org.objectstyle.wolips.eomodeler.core.sql.EOFSQLGeneratorFactory$ReflectionSQLGenerator.generateSchemaCreationScript(EOFSQLGeneratorFactory.java:67)
            at org.objectstyle.wolips.eomodeler.actions.GenerateSQLDialog.generateSql(GenerateSQLDialog.java:298)
            at org.objectstyle.wolips.eomodeler.actions.GenerateSQLDialog$1.run(GenerateSQLDialog.java:279)
            at java.lang.Thread.run(Thread.java:637)
    Caused by: java.lang.reflect.InvocationTargetException
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:597)
            at org.objectstyle.wolips.eomodeler.core.sql.EOFSQLGeneratorFactory$ReflectionSQLGenerator.generateSchemaCreationScript(EOFSQLGeneratorFactory.java:65)
            ... 3 more
    Caused by: java.lang.NullPointerException
            at com.webobjects.jdbcadaptor.JDBCExpression.columnTypeStringForAttribute(JDBCExpression.java:286)
            at com.webobjects.eoaccess.EOSQLExpression.addCreateClauseForAttribute(EOSQLExpression.java:2498)
            at com.webobjects.eoaccess.EOSynchronizationFactory.createTableStatementsForEntityGroup(EOSynchronizationFactory.java:318)
            at com.webobjects.eoaccess.EOSynchronizationFactory.createTableStatementsForEntityGroups(EOSynchronizationFactory.java:487)
            at com.webobjects.eoaccess.EOSynchronizationFactory.schemaCreationStatementsForEntities(EOSynchronizationFactory.java:951)
            at com.webobjects.eoaccess.EOSynchronizationFactory.schemaCreationScriptForEntities(EOSynchronizationFactory.java:747)
            at org.objectstyle.wolips.eomodeler.core.sql.EOFSQLGenerator53.generateSchemaCreationScript(EOFSQLGenerator53.java:483)
            ... 8 more

    -- 
    This message is automatically generated by JIRA.
    -
    If you think it was sent incorrectly contact one of the administrators: http://issues.objectstyle.org/jira/secure/Administrators.jspa
    -
    For more information on JIRA, see: http://www.atlassian.com/software/jira
    



    This archive was generated by hypermail 2.0.0 : Mon Mar 01 2010 - 11:06:55 EST