Re: Indices

From: Mike Kienenberger (mkienen..laska.net)
Date: Fri Jan 07 2005 - 11:59:08 EST

  • Next message: Andrus Adamchik: "Re: How to do GROUP BY dynamically?"

    =?UTF-8?B?Qm9ydXQgQm9sxI1pbmE=?= <cayenn..mail.si> wrote:
    > What you are saying is, that there is no way in Cayenne to create a
    > database table programmatically - through API I mean?

    That's what I thought, but I was wrong -- see below.

    =?UTF-8?B?Qm9ydXQgQm9sxI1pbmE=?= <cayenn..mail.si> wrote:
    > thanks for your reply. I did not quite understand this sentance: "For
    > now you can use Cayenne schema generation API to create basic tables, ..."
    >
    > Can you point me to a class(es) responsible for table creation, I have
    > to get know the API better.

    The class that sets it up is in
    org.objectstyle.cayenne.modeler.dialog.db.DBGeneratorOptions
    (cayenne-modeler.jar). You can use this as a reference for your own code,
    but it looks as simple as creating a new DBGenerator instance, then calling
    runGenerator().

    The class that does the work is in
    org.objectstyle.cayenne.access.DbGenerator (cayenne.jar). Up to this point
    I hadn't realized that the DBGenerator was part of the Cayenne core.

    That's very cool :)

    I'm going to have to take advantage of this in my unit test setup.

    -Mike



    This archive was generated by hypermail 2.0.0 : Fri Jan 07 2005 - 11:57:08 EST