Community opinion of Hibernate

Discussion in 'Spigot Discussion' started by netherfoam, May 23, 2017.

  1. Hi guys,

    I'm using Hibernate in my project: http://hibernate.org/. It's a bit of a behemoth of a library, but it provides easy ORM mapping between SQL database rows and objects. For example, I can represent rows in my Mute table from my SQL server as Mute objects inside the JVM.

    I'm wondering, what's the community opinion on this? I know over at Bukkit they had a strict review process (Treating developers like children... To be fair, they mostly are). Do guidelines here prevent me from adding such a large library and releasing it publicly? I can imagine it'd be a nuisance for reviewers to trawl the 12MB library for suspicious code.

    Keen to hear anyones input on the matter!
     
  2. Don't use it
     
    • Informative Informative x 1
  3. MiniDigger

    Supporter

    hibernate is nice, however using it in a bukkit plugin was a pain pre 1.12 since bukkit shades its own ORM, ebean, which is outdated for years (version is 5 years old) and shades jpa 1.0. hibernate needs 2.1 so it causes all kind of stupid problems.
    in 1.12 ebean was removed, so you should be fine.
    for file size: there is a limit how large your file can get, not sure how much tho. I think that there also is a difference between free and "premium" resources. free resources don't get reviewed
    so can try shading it in and see how much maven shade minimize can turn the file size down.
     
    • Useful Useful x 1
  4. Awesome. I had a small issue with the servers shaded version, but I resolved it without any issues. Interesting to hear free resources don't get reviewed here! The entire library ends up increasing the size of the jar by about 10.2MB but I haven't tried to optimise that.

    At risk of feeding a troll, what's your experience with it?
     
  5. I believe 4mb is the max, there is also no difference in max size between free & premium to my knowledge.
     
    • Useful Useful x 1
  6. My IRL job is web design
     
  7. MiniDigger

    Supporter

    mmmh, if you exceed the limit you can always still use hibernate, but not shading it in but downloading it on demand and adding it to the classpath at runtime.
     
  8. I'm in a similar position. What's your qualm with hibernate?

    After a bit of a haphazard attempt (Testing in production, anyone?) I managed to upload the plugin as an external link and it wasn't forced to adhere to the 4MB file limit.

    With the minimise maven goal I managed to slim off 4MB from the Jar, and I managed to create a ZIP of the file which shaved off another 1MB by using the maximum compression. 7MB is still a bit over the 4MB limit though, good thing I could upload it externally!
     
  9. MiniDigger

    Supporter

    he hasn't touched it yet I bet.
    ahh, I knew that there was another way around the limit ^^
    glad you got it working