Skip to main content
Known Participant
April 13, 2011
Question

Hibernate compliance

  • April 13, 2011
  • 1 reply
  • 692 views

Hello,

how much of Hibernate is within CF? Every example from hibernate website does work?

Thanks

    This topic has been closed for replies.

    1 reply

    Owainnorth
    Inspiring
    April 14, 2011

    The simple answer is: it's complicated.

    I believe that underneath CF is just the standard Hibernate engine, I don't think they've taken anything out. However that's the best of my knowledge, and I'm happy to be corrected.

    The frustration is that CF have not implemented all the aspects natively, so sometimes you can only achieve what you want by diving into the hbmxml files and editing them manually. This causes further ballache as CF does not then update said files when you make changes to your CFCs, so you get your CFCs being out of sync with the xml files and lots of weirdness going on.

    CF ORM is great for basic Hibernate stuff, but anything more complicated I've found quicker to go the old-fashioned route and just use a non-ORM model.

    12Robots
    Participating Frequently
    April 14, 2011

    I'm sorry but that is ridiculous.  The Adobe engineers gave us access to the underlying hibernate engine and the ability to create custom hbxml files JUST so we could do more complicated stuff.  None of that was hidden from us.

    Yeah, sure, when you go that route ColdFusion isn't going to make updates for you automatically when you change a CFC, but that in NO WAY reduces the usefulness and puroses of ORM.

    Owainnorth
    Inspiring
    April 14, 2011

    I never said it reduces the usefullness, I said that it's frustrating having a bastardised version of Hibernate available in CF9 and constantly having to battle between CF and Hibernate to get it to do what you want.

    Granted, it didn't help that I first tried using it when CF9 first came out, and there was very little experience or resource around to help.

    Just stupid things - I burned a load of hours trying to fix an issue I had, just to find that it was due to case-sensitivity in the hbmxml files. ColdFusion is obviously not a case-sensitive product, so it was not something I'd expected. It's just little things like that which put me off.

    As for:

    ColdFusion isn't going to make updates for you automatically when you change a CFC, but that in NO WAY reduces the usefulness and puroses of ORM.

    Personally, I think it does. I found it *extremely* annoying having to constantly take out the extra code I'd put into the xml file, delete the xml file, turn on the app setting to create files then put my code back in just because I'd added a property to a CFC.

    You only have to look at the posts and queries that come up on here - if you've used Hibernate then great; you know what's going on behind the scenes and you can work with that. But the people (myself included) who hadn't previously used it just come up against problems when trying to do such basic things, it just shows that ORM through CF is still very much in its infancy.