FAQ
Hello friends,

I'm doing a job about cayenne and i want to know
what are the main interfaces of cayenne?

and

what are the main differences between the cayenne and hibernate?

Thank you for the help!!!!
--
View this message in context: http://www.nabble.com/The-most-important-interfaces-of-Cayenne-tp20440918p20440918.html
Sent from the Cayenne - User mailing list archive at Nabble.com.

Search Discussions

  • Andrey Razumovsky at Nov 11, 2008 at 3:19 pm
    You should probably start with reading documentation on project site. Main
    interfaces are DataContext (ObjectContext), persistent and so on.
    About Hibernate:
    http://cwiki.apache.org/confluence/display/CAY/From+Hibernate+to+Cayenne

    2008/11/11, Jefferson Brazil <jefferson.maretti@gmail.com>:

    Hello friends,

    I'm doing a job about cayenne and i want to know
    what are the main interfaces of cayenne?

    and

    what are the main differences between the cayenne and hibernate?

    Thank you for the help!!!!

    --
    View this message in context:
    http://www.nabble.com/The-most-important-interfaces-of-Cayenne-tp20440918p20440918.html
    Sent from the Cayenne - User mailing list archive at Nabble.com.
  • Andrus Adamchik at Nov 11, 2008 at 3:35 pm
    Yeah, start with a tutorial:

    http://cayenne.apache.org/doc20/quick-start.html

    and by the end of it you will get an idea of what are the main things
    in Cayenne. As for Hibernate comparison, for starters I think you'd
    get a much smoother learning experience with Cayenne.

    Good luck!

    Andrus

    On Nov 11, 2008, at 5:19 PM, Andrey Razumovsky wrote:
    You should probably start with reading documentation on project
    site. Main
    interfaces are DataContext (ObjectContext), persistent and so on.
    About Hibernate:
    http://cwiki.apache.org/confluence/display/CAY/From+Hibernate+to+Cayenne

    2008/11/11, Jefferson Brazil <jefferson.maretti@gmail.com>:

    Hello friends,

    I'm doing a job about cayenne and i want to know
    what are the main interfaces of cayenne?

    and

    what are the main differences between the cayenne and hibernate?

    Thank you for the help!!!!

    --
    View this message in context:
    http://www.nabble.com/The-most-important-interfaces-of-Cayenne-tp20440918p20440918.html
    Sent from the Cayenne - User mailing list archive at Nabble.com.
  • Theresa Stewart at Nov 11, 2008 at 4:04 pm
    I started with the tutorial, and this gave me an example to refer to.

    Then I built up from the tutorial, using the Users Guide. I tried
    pretty much every feature that I will need to understand (due to an
    existing software base that I will contribute to), and I've placed this
    "strawman" onto the modelling version of Eclipse (so I can see the tools
    available to me to help learn a software architecture for an existing
    system), and plan to use it to help evaluate GUI testing tools. There's
    nothing like putting yourself into a "hot seat" and trying to make
    something work the way you visualize it to work.

    "It is difficult, if not impossible, for anyone to learn a subject
    purely by reading about it,
    Without applying the information to specific problems
    and thereby forcing himself to thing about what has been read.

    Furthermore, we all learn best the things that we have discovered
    ourselves."
    -Donald Knuth,
    The Art of Computer Programming


    -----Original Message-----
    From: Andrus Adamchik
    Sent: Tuesday, November 11, 2008 9:35 AM
    To: user@cayenne.apache.org
    Subject: Re: The most important interfaces of Cayenne

    Yeah, start with a tutorial:

    http://cayenne.apache.org/doc20/quick-start.html

    and by the end of it you will get an idea of what are the main things
    in Cayenne. As for Hibernate comparison, for starters I think you'd
    get a much smoother learning experience with Cayenne.

    Good luck!

    Andrus

    On Nov 11, 2008, at 5:19 PM, Andrey Razumovsky wrote:
    You should probably start with reading documentation on project
    site. Main
    interfaces are DataContext (ObjectContext), persistent and so on.
    About Hibernate:
    http://cwiki.apache.org/confluence/display/CAY/From+Hibernate+to+Cayenne
    2008/11/11, Jefferson Brazil <jefferson.maretti@gmail.com>:

    Hello friends,

    I'm doing a job about cayenne and i want to know
    what are the main interfaces of cayenne?

    and

    what are the main differences between the cayenne and hibernate?

    Thank you for the help!!!!

    --
    View this message in context:
    http://www.nabble.com/The-most-important-interfaces-of-Cayenne-tp2044091
    8p20440918.html
    Sent from the Cayenne - User mailing list archive at Nabble.com.
  • Michael Gentry at Nov 12, 2008 at 3:13 pm
    In Cayenne, the DataContext (or ObjectContext), queries (like
    SelectQuery), and data objects (subclasses of CayenneDataObject, which
    are created by Cayenne Modeler and map to database records) are the
    main workhorses.

    The DataContext is used to perform queries which fetch data objects.
    The DataContext manages all data objects you fetch from the database,
    plus allows you to insert new data objects, and commit all changes to
    the database in a transaction. The DataContext knows what has been
    changed and smartly inserts/updates/deletes for you.

    I don't know much about Hibernate, but do know it manages data objects
    differently. In Cayenne, even after you commit your changes to the
    database, your data objects are still fully functional. In Hibernate,
    you can get a LazyInitializationException because when you commit in
    Hibernate, it disconnects all of the objects from the database
    connection.

    Example (Hibernate):

    session.beginTransaction();
    Artist artist = getArtist(); // assume this fetches an Artist
    // Code which updates artist
    session.commit();
    artist.getPaintings(); // Throws exception

    In Hibernate, you'd have to call getPaintings() within the session.
    In Cayenne, it doesn't matter if you commit and then ask for the
    Paintings or ask for the Paintings and then commit. This may seem a
    minor detail, but in web applications it is even more important
    because at the end of a request/response loop, all Hibernate objects
    are disconnected from their session/database connection. Therefore
    you have to re-connect all of your database objects in the next web
    request/response loop to prevent exceptions. In Cayenne, everything
    remains connected for you. In my mind, Cayenne works more like you'd
    expect in this scenario.

    Hope that helps and let us know if you have more questions.

    /dev/mrg


    On Tue, Nov 11, 2008 at 9:41 AM, Jefferson Brazil
    wrote:
    Hello friends,

    I'm doing a job about cayenne and i want to know
    what are the main interfaces of cayenne?

    and

    what are the main differences between the cayenne and hibernate?

    Thank you for the help!!!!
    --
    View this message in context: http://www.nabble.com/The-most-important-interfaces-of-Cayenne-tp20440918p20440918.html
    Sent from the Cayenne - User mailing list archive at Nabble.com.
  • Scott Anderson at Nov 12, 2008 at 7:24 pm
    Minor nit-pick, Michael: there's nothing in Hibernate preventing you
    from leaving a session open at all times, treating the session as a
    context, so your assertion that it is less intuitive for that reason is,
    perhaps, unfair. Of course, Hibernate is indeed less intuitive, but not
    for that reason. :)
  • Michael Gentry at Nov 12, 2008 at 7:36 pm
    Thanks, Scott. I didn't get very deep into Hibernate and that was a
    common issue I saw at the time. Just curious, can you leave the
    session open at all times in a multithreaded web application? What
    happens if you leave it open and the user doesn't come back?

    On Wed, Nov 12, 2008 at 2:24 PM, Scott Anderson wrote:
    Minor nit-pick, Michael: there's nothing in Hibernate preventing you
    from leaving a session open at all times, treating the session as a
    context, so your assertion that it is less intuitive for that reason is,
    perhaps, unfair. Of course, Hibernate is indeed less intuitive, but not
    for that reason. :)
  • Scott Anderson at Nov 13, 2008 at 6:26 pm
    I can't say for certain, since I've never tested it. I think it would be
    okay to read/write an object that "belongs" to a different thread, much
    the same way it's possible in Cayenne despite a clear ownership by a
    thread, so long as commit()s are synchronized so they do not conflict
    with a read/write.

    -----Original Message-----
    From: Michael Gentry
    Sent: Wednesday, November 12, 2008 2:36 PM
    To: user@cayenne.apache.org
    Subject: Re: The most important interfaces of Cayenne

    Thanks, Scott. I didn't get very deep into Hibernate and that was a
    common issue I saw at the time. Just curious, can you leave the
    session open at all times in a multithreaded web application? What
    happens if you leave it open and the user doesn't come back?

    On Wed, Nov 12, 2008 at 2:24 PM, Scott Anderson wrote:
    Minor nit-pick, Michael: there's nothing in Hibernate preventing you
    from leaving a session open at all times, treating the session as a
    context, so your assertion that it is less intuitive for that reason is,
    perhaps, unfair. Of course, Hibernate is indeed less intuitive, but not
    for that reason. :)

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupuser @
categoriescayenne
postedNov 11, '08 at 2:41p
activeNov 13, '08 at 6:26p
posts8
users6
websitecayenne.apache.org

People

Translate

site design / logo © 2022 Grokbase