FAQ
Hi,

Is there a migration guide from Hibernate(especially 2.x.x) to Cayenne
(whatever version)?

Or even better, is there maybe some tool that helps this even further?
(when moving from Velocity to Freemarker there's a tool to automate this,
and even other frameworks have "migration" tools to help uses move from the
concurrence :) )

Thank you,

Tom.
--
View this message in context: http://www.nabble.com/How-to-migrate-from-Hibernate-to-Cayenne--tp15596160p15596160.html
Sent from the Cayenne - User mailing list archive at Nabble.com.

Search Discussions

  • Scott Anderson at Feb 20, 2008 at 7:58 pm
    Tom,

    Take a look at the Cayenne Modeler; there is a feature to "Reengineer
    Database Schema" on the tools menu. You may be unable to do this with
    standard user-level permissions, depending on your database type and
    configuration. Then you'll be able to generate the POJOs which should
    resemble quite closely your hibernate POJOs.

    Regards,
    Scott

    -----Original Message-----
    From: Thomas Bernhard
    Sent: Wednesday, February 20, 2008 2:09 PM
    To: [email protected]
    Subject: How to migrate from Hibernate to Cayenne?


    Hi,

    Is there a migration guide from Hibernate(especially 2.x.x) to Cayenne
    (whatever version)?

    Or even better, is there maybe some tool that helps this even further?
    (when moving from Velocity to Freemarker there's a tool to automate
    this, and even other frameworks have "migration" tools to help uses move
    from the concurrence :) )

    Thank you,

    Tom.
    --
    View this message in context:
    http://www.nabble.com/How-to-migrate-from-Hibernate-to-Cayenne--tp155961
    60p15596160.html
    Sent from the Cayenne - User mailing list archive at Nabble.com.
  • Thomas Bernhard at Feb 20, 2008 at 9:06 pm

    Scott A wrote:

    Take a look at the Cayenne Modeler; there is a feature to "Reengineer
    Database Schema" on the tools menu. You may be unable to do this with
    standard user-level permissions, depending on your database type and
    configuration. Then you'll be able to generate the POJOs which should
    resemble quite closely your hibernate POJOs.
    I'm aware of CM and the reengineer feature, but unfortunately it does only a
    small part of the work.

    When the Hibernate applciation was made, it was mostly "generated" with
    Hibernate Synchronizer.
    It has generated not only the POJOs but the DAOs and default queries for the
    entire model too (and composite PKs too) - all these without tweaking
    directly from the config files (generated form the DB with middlegen) with
    just a few clicks.

    CM however doesn't seem to have these "advanced" generation features :(.
    Is the default "way" in Cayenne to do these manually?

    Thank you,

    Tom.
    --
    View this message in context: http://www.nabble.com/How-to-migrate-from-Hibernate-to-Cayenne--tp15596160p15598178.html
    Sent from the Cayenne - User mailing list archive at Nabble.com.
  • Mike Kienenberger at Feb 20, 2008 at 9:17 pm
    Cayenne does have the same capabilities. I generate DAOs, interfaces,
    web pages, config files, and, on occasion, entire applications (struts
    & jsf) from the Cayenne modeler using the cgen ant task. You can
    also do this from the Cayenne Modeler directly now.

    But...

    You will need to provide your own templates to do it.
    Cayenne does not provide such templates, except for POJOs.

    And it's in velocity, not freemarker, since you brought up your
    migration from one to the other.

    On Wed, Feb 20, 2008 at 4:05 PM, Thomas Bernhard wrote:


    Scott A wrote:
    Take a look at the Cayenne Modeler; there is a feature to "Reengineer
    Database Schema" on the tools menu. You may be unable to do this with
    standard user-level permissions, depending on your database type and
    configuration. Then you'll be able to generate the POJOs which should
    resemble quite closely your hibernate POJOs.
    I'm aware of CM and the reengineer feature, but unfortunately it does only a
    small part of the work.

    When the Hibernate applciation was made, it was mostly "generated" with
    Hibernate Synchronizer.
    It has generated not only the POJOs but the DAOs and default queries for the
    entire model too (and composite PKs too) - all these without tweaking
    directly from the config files (generated form the DB with middlegen) with
    just a few clicks.

    CM however doesn't seem to have these "advanced" generation features :(.
    Is the default "way" in Cayenne to do these manually?

    Thank you,

    Tom.
    --
    View this message in context: http://www.nabble.com/How-to-migrate-from-Hibernate-to-Cayenne--tp15596160p15598178.html


    Sent from the Cayenne - User mailing list archive at Nabble.com.
  • Thomas Bernhard at Feb 20, 2008 at 10:42 pm

    Mike Kienenberger wrote:

    Cayenne does have the same capabilities. I generate DAOs, interfaces,
    web pages, config files, and, on occasion, entire applications (struts
    & jsf) from the Cayenne modeler using the cgen ant task. You can
    also do this from the Cayenne Modeler directly now.

    But...

    You will need to provide your own templates to do it.
    Cayenne does not provide such templates, except for POJOs.
    Well I read it so: "it could have the same capabitlities, but it doesn't
    unless you implement those templates" :).

    Besides, it's not just about about a bunch of templates, but the required
    GUI to turn the individual features on/off or aditional parameters.
    I checked the entire CM but I see that at the moment the GUI of CM supports
    only POJOs.

    Tom
    --
    View this message in context: http://www.nabble.com/How-to-migrate-from-Hibernate-to-Cayenne--tp15596160p15600743.html
    Sent from the Cayenne - User mailing list archive at Nabble.com.
  • Andrus Adamchik at Feb 20, 2008 at 9:21 pm
    If you have a "regular" generated structure in your data layer, you
    can hack up a Velocity cgen template to match what you have for the
    Hibernate project and run it either with the Modeler or better - with
    cgen Ant task.

    For some sample templates, check out "src/dotemplates/v1_2" folder in
    the Cayenne distro.

    Andrus

    On Feb 20, 2008, at 11:05 PM, Thomas Bernhard wrote:

    Scott A wrote:
    Take a look at the Cayenne Modeler; there is a feature to "Reengineer
    Database Schema" on the tools menu. You may be unable to do this with
    standard user-level permissions, depending on your database type and
    configuration. Then you'll be able to generate the POJOs which should
    resemble quite closely your hibernate POJOs.
    I'm aware of CM and the reengineer feature, but unfortunately it
    does only a
    small part of the work.

    When the Hibernate applciation was made, it was mostly "generated"
    with
    Hibernate Synchronizer.
    It has generated not only the POJOs but the DAOs and default queries
    for the
    entire model too (and composite PKs too) - all these without tweaking
    directly from the config files (generated form the DB with
    middlegen) with
    just a few clicks.

    CM however doesn't seem to have these "advanced" generation
    features :(.
    Is the default "way" in Cayenne to do these manually?

    Thank you,

    Tom.
    --
    View this message in context: http://www.nabble.com/How-to-migrate-from-Hibernate-to-Cayenne--tp15596160p15598178.html
    Sent from the Cayenne - User mailing list archive at Nabble.com.
  • Thomas Bernhard at Feb 20, 2008 at 10:54 pm

    Andrus Adamchik wrote:

    If you have a "regular" generated structure in your data layer, you
    can hack up a Velocity cgen template to match what you have for the
    Hibernate project and run it either with the Modeler or better - with
    cgen Ant task.
    There's some structure but it is too "hibernate oriented", and it doesn't
    looks like what I see in most example applcations that use Cayenne :).
    I think since Cayenne has it's own style, CM could generate according to
    this style.


    Andrus Adamchik wrote:
    For some sample templates, check out "src/dotemplates/v1_2" folder in
    the Cayenne distro.
    That's nice, but it would be even nicer if some sort of GUI could be defined
    together with custom templates as in most cases more imput is required from
    the user.

    Thank you,

    Tom.
    --
    View this message in context: http://www.nabble.com/How-to-migrate-from-Hibernate-to-Cayenne--tp15596160p15600868.html
    Sent from the Cayenne - User mailing list archive at Nabble.com.
  • Borut Bolčina at Feb 21, 2008 at 2:49 pm
    Hello,

    since when can modeler generate POJOs? AFAIK those generated classes extend
    CayenneDataObject which in turn implements three interfaces, therefore
    making it a complex object model.

    Did I miss something lately?

    -Borut

    2008/2/20, Scott Anderson <[email protected]>:
    Tom,

    Take a look at the Cayenne Modeler; there is a feature to "Reengineer
    Database Schema" on the tools menu. You may be unable to do this with
    standard user-level permissions, depending on your database type and
    configuration. Then you'll be able to generate the POJOs which should
    resemble quite closely your hibernate POJOs.

    Regards,

    Scott


    -----Original Message-----
    From: Thomas Bernhard
    Sent: Wednesday, February 20, 2008 2:09 PM
    To: [email protected]
    Subject: How to migrate from Hibernate to Cayenne?


    Hi,

    Is there a migration guide from Hibernate(especially 2.x.x) to Cayenne
    (whatever version)?

    Or even better, is there maybe some tool that helps this even further?
    (when moving from Velocity to Freemarker there's a tool to automate
    this, and even other frameworks have "migration" tools to help uses move
    from the concurrence :) )

    Thank you,

    Tom.
    --
    View this message in context:
    http://www.nabble.com/How-to-migrate-from-Hibernate-to-Cayenne--tp155961
    60p15596160.html
    Sent from the Cayenne - User mailing list archive at Nabble.com.
  • Malcolm Edgar at Feb 21, 2008 at 10:38 pm
    <rant>

    Well personally I think the whole POJO thing has been completely over
    done. Sure EJB entity beans were not much fun, but saying everything
    should now extend java.util.Object is stupid. With persistence API
    entities need a bunch of support, you can use Cayenne model where you
    subclass intelligent objects, or you can use "black magic" runtime
    byte code enhancement. I prefer the former because I can drill
    through the code, and use a debugger. However all the fashion now days
    it to go down the byte code enhancement path.

    This is particularly stupid with Web frameworks, which have recently
    adopted this fashion. Now you see POJO's being used as a kind of a
    page, with a bunch of annotations, maybe some XML configuration files,
    and then some special byte code enhancement. No decent windowing UI
    framework has ever taken this approach Dephi, Swing, Flex.

    The thing that I find really ironic, is that the Hibernate guys who
    were using reflection previously bet the crap out of JDO camp, because
    JDO were using invasive post compilation byte code enhancement. Now
    Hibernate now are using runtime byte code enhancement, but have still
    manage to kill JDO, and create a new JPA based on their design.

    </rant>

    regards Malcolm Edgar
    On Fri, Feb 22, 2008 at 1:49 AM, Borut Bolčina wrote:
    Hello,

    since when can modeler generate POJOs? AFAIK those generated classes extend
    CayenneDataObject which in turn implements three interfaces, therefore
    making it a complex object model.

    Did I miss something lately?

    -Borut

    2008/2/20, Scott Anderson <[email protected]>:

    Tom,

    Take a look at the Cayenne Modeler; there is a feature to "Reengineer
    Database Schema" on the tools menu. You may be unable to do this with
    standard user-level permissions, depending on your database type and
    configuration. Then you'll be able to generate the POJOs which should
    resemble quite closely your hibernate POJOs.

    Regards,

    Scott


    -----Original Message-----
    From: Thomas Bernhard
    Sent: Wednesday, February 20, 2008 2:09 PM
    To: [email protected]
    Subject: How to migrate from Hibernate to Cayenne?


    Hi,

    Is there a migration guide from Hibernate(especially 2.x.x) to Cayenne
    (whatever version)?

    Or even better, is there maybe some tool that helps this even further?
    (when moving from Velocity to Freemarker there's a tool to automate
    this, and even other frameworks have "migration" tools to help uses move
    from the concurrence :) )

    Thank you,

    Tom.
    --
    View this message in context:
    http://www.nabble.com/How-to-migrate-from-Hibernate-to-Cayenne--tp155961
    60p15596160.html
    Sent from the Cayenne - User mailing list archive at Nabble.com.
  • Michael Gentry at Feb 21, 2008 at 11:52 pm
    I pretty much concur with Malcom's thoughts. You aren't alone. :-)

    2008/2/21 Malcolm Edgar <[email protected]>:
    <rant>

    Well personally I think the whole POJO thing has been completely over
    done. Sure EJB entity beans were not much fun, but saying everything
    should now extend java.util.Object is stupid. With persistence API
    entities need a bunch of support, you can use Cayenne model where you
    subclass intelligent objects, or you can use "black magic" runtime
    byte code enhancement. I prefer the former because I can drill
    through the code, and use a debugger. However all the fashion now days
    it to go down the byte code enhancement path.

    This is particularly stupid with Web frameworks, which have recently
    adopted this fashion. Now you see POJO's being used as a kind of a
    page, with a bunch of annotations, maybe some XML configuration files,
    and then some special byte code enhancement. No decent windowing UI
    framework has ever taken this approach Dephi, Swing, Flex.

    The thing that I find really ironic, is that the Hibernate guys who
    were using reflection previously bet the crap out of JDO camp, because
    JDO were using invasive post compilation byte code enhancement. Now
    Hibernate now are using runtime byte code enhancement, but have still
    manage to kill JDO, and create a new JPA based on their design.

    </rant>

    regards Malcolm Edgar
  • Chris Murphy at Feb 22, 2008 at 1:21 am
    I concur with paragraph two - it seems that web frameworks have a way to go (excepting GWT et al)
    before just having getters and setters for controls, so you can drag and drop the visual part of
    an application together at design time, and then separately be concerned about programming
    the events. See www.strandz.org for an ideal way of creating a user-interfaced application,
    that kind of abstracts out MVC thinking...

    - Chris Murphy

    Michael Gentry wrote: I pretty much concur with Malcom's thoughts. You aren't alone. :-)
    2008/2/21 Malcolm Edgar <malco[email protected]>: <rant> Well personally I think the
    whole POJO thing has been completely over done. Sure EJB entity beans were not much fun, but
    saying everything should now extend java.util.Object is stupid. With persistence API
    entities need a bunch of support, you can use Cayenne model where you subclass intelligent
    objects, or you can use "black magic" runtime byte code enhancement. I prefer the former
    because I can drill through the code, and use a debugger. However all the fashion now days it to
    go down the byte code enhancement path. This is particularly stupid with Web frameworks,
    which have recently adopted this fashion. Now you see POJO's being used as a kind of a page, with
    a bunch of annotations, maybe some XML configuration files, and then some special byte code
    enhancement. No decent windowing UI framework has ever taken this approach Dephi, Swing,
    Flex. The thing that I find really ironic, is that the Hibernate guys who were using reflection
    previously bet the crap out of JDO camp, because JDO were using invasive post compilation byte
    code enhancement. Now Hibernate now are using runtime byte code enhancement, but have still
    manage to kill JDO, and create a new JPA based on their design. </rant> regards Malcolm Edgar
  • Andrus Adamchik at Feb 20, 2008 at 8:03 pm
    AFAIK no such thing exists as of now. Not sure about others, but
    luckily I was spared from any such migrations. Would be nice if
    somebody with a real experience could document what they needed to do.

    My guess on the high level approach would be to start with reverse
    engineering the DB schema, and generating Cayenne superclasses with
    Hibernate current classes mapped as subclasses. And then fix the API
    calls manually. But I am sure there are quirks for non-flat mapping
    scenarios (inheritance and such). Also you may need to rethink some
    app concepts... E.g. Cayenne doesn't force transactions on you unless
    you *must* have them... things like that.

    Andrus

    P.S. When I was about to hit "send", I noticed a message from Scott
    Anderson, based on the same idea.

    On Feb 20, 2008, at 9:08 PM, Thomas Bernhard wrote:


    Hi,

    Is there a migration guide from Hibernate(especially 2.x.x) to Cayenne
    (whatever version)?

    Or even better, is there maybe some tool that helps this even further?
    (when moving from Velocity to Freemarker there's a tool to automate
    this,
    and even other frameworks have "migration" tools to help uses move
    from the
    concurrence :) )

    Thank you,

    Tom.
    --
    View this message in context: http://www.nabble.com/How-to-migrate-from-Hibernate-to-Cayenne--tp15596160p15596160.html
    Sent from the Cayenne - User mailing list archive at Nabble.com.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriescayenne
postedFeb 20, '08 at 7:09p
activeFeb 22, '08 at 1:21a
posts12
users8
websitecayenne.apache.org

People

Translate

site design / logo © 2023 Grokbase