Hacker Newsnew | comments | show | ask | jobs | submitlogin
auvrw 190 days ago | link | parent

a really solid, perhaps unique, library that, as far as i can tell, completely addresses the "impedence mismatch" argument. if you're directly using a database api in a structured way, you've probably already reimplemented the sqlalchemy core, and refactoring your program to use sqlalchemy will give you an orm, should you want one, and make your code portable across database implementations even if you don't. if you're already using an orm, refactoring to use sqlalchemy will allow you to to start optimizing the low-level database operations in a coherent way (i.e. not just sprinkling SQL throughout the models). there's a nice writeup in the architecture of open source applications ( http://www.aosabook.org/en/sqlalchemy.html )

now, fantods aside, is there anything like this for java? according to the aosa writeup, sqlalchemy's author found python's multiple inheritance useful for implementing certain ideas, so porting probably isn't straightforward. also, the relevant stackoverflow question ( http://stackoverflow.com/questions/10537766/closest-equivale... ) seems inconclusive.

this is not to criticize java as a language, but rather because i really wish there was something like sqlalchemy for java.



yareally 190 days ago | link

> i really wish there was something like sqlalchemy for java.

Ebean[1], perhaps? I've only used it for a project in Play 2.0 that was built on Java (it's built into Play 2.0), but it was far less painful compared to other Java ORM libaries like Hibernate.

[1] http://www.avaje.org/ebean/getstarted_props.html

-----

goostavos 190 days ago | link

This might be a "LMGTFY" type question, but having never used SQLAlchemy, what sets is apart from something like Hibernate?

-----

storborg 190 days ago | link

It's very similar to a "Hibernate for Python", and I believe it started out that way. However, it has since surpassed Hibernate in capabilities, and presents elegant APIs that cover a more substantial fraction of "things you'd want to do in SQL".

-----

babs474 190 days ago | link

I find Jooq to be similiar in some ways.

http://www.jooq.org

-----

reactor 190 days ago | link

http://www.querydsl.com/ as well.

-----

Edmond 190 days ago | link

You could also check out Crudzilla (crudzilla.com), it has a middleware that simply allows you to specify your SQL and forget about everything else. Includes a bunch of other goodies that'll make web development a pleasure :)

Full disclosure: Founder.

-----

noise 189 days ago | link

MyBatis (formerly iBatis) might be a good option. It's been years since I used it but it's a lightweight alternative to Hibernate: http://blog.mybatis.org/

-----




Guidelines | FAQ | Lists | RSS | Bookmarklet | DMCA | News News | Bugs and Feature Requests | Y Combinator | Apply | Library | Contact

Search: