Modifying projects in Java

From: Mikaël Cluseau (mikae..sinc.dyndns.org)
Date: Thu Jul 12 2007 - 18:30:25 EDT

  • Next message: Greg Boshart: "RE: problems with Oracle stored procedure"

    Dear list,

    I'm trying to modify projects in Java code (mainly to migrate old
    schemas automatically) and I can't save project with DataNodes.

    Here is the simplest expression of my need :

    File projectFile = new File("src/cayenne.xml");
    ApplicationProject project = new ApplicationProject(projectFile);
    ProjectConfiguration config = (ProjectConfiguration) project.getConfiguration();
    project.save();

    It works well as long as the projet doesn't have any DataNode. Here is
    the relevant part of the stack trace:

    Caused by: java.lang.ClassCastException: org.apache.cayenne.access.DataNode$TransactionDataSource cannot be cast to org.apache.cayenne.project.ProjectDataSource
            at org.apache.cayenne.project.DataNodeFile.save(DataNodeFile.java:64)

    I don't get how the modeler manages to get it working (it looks pretty
    straightforward so I must be missing something).

    I'm currently working by removing DataNodes from the project and adding
    them back, so it is not very... fun. Can someone please point me at
    least ways to solve the issue ?

    I had it "working" by setting every node's DataSourceFactory to
    ProjectDataSourceFactory *but* it destroys their data...

    Thanks !

    --
    Mikaël Cluseau
    



    This archive was generated by hypermail 2.0.0 : Thu Jul 12 2007 - 18:31:01 EDT