x****d 发帖数: 1766 | 1 I found most developers know a lot about structural aspect of o/r mismatch
but most of them dont know enough about behaviour aspect, like persistent
context, proxy those stuff.
So can you please share with me what are the difficult things when you
working with hibernate? I want to understand if they are due to structural
or behaviour aspect.
The other day I read zhaoce mentioned a bit about that he spends more time
on orm stuff than mvc, maybe he can zkss?
Another thing is mybatis is getting some momentums, what do you guys think
about it? My understand is that developer don't like to deal with behaviour
aspect, mybatis is just focus on structural aspect and seems provide more
control with sql stuff.
What is your thoughts, guys? |
d****i 发帖数: 4809 | 2 I didn't use any orm framework. I only use Spring JDBC and found it very
easy to use without any hassles. Is it good enough for most applications?
behaviour
【在 x****d 的大作中提到】![](/moin_static193/solenoid/img/up.png) : I found most developers know a lot about structural aspect of o/r mismatch : but most of them dont know enough about behaviour aspect, like persistent : context, proxy those stuff. : So can you please share with me what are the difficult things when you : working with hibernate? I want to understand if they are due to structural : or behaviour aspect. : The other day I read zhaoce mentioned a bit about that he spends more time : on orm stuff than mvc, maybe he can zkss? : Another thing is mybatis is getting some momentums, what do you guys think : about it? My understand is that developer don't like to deal with behaviour
|
x****d 发帖数: 1766 | 3 as developer, you don't choose what you use. you have to know orm to pass an
interview.
【在 d****i 的大作中提到】![](/moin_static193/solenoid/img/up.png) : I didn't use any orm framework. I only use Spring JDBC and found it very : easy to use without any hassles. Is it good enough for most applications? : : behaviour
|
d****i 发帖数: 4809 | 4 i'm a newbie. But i heard that orm tends to be too complicated and
convoluted. So i choose simpler and easy one which gives me necessary
functionality. Are there any added benefits of using orm?
an
【在 x****d 的大作中提到】![](/moin_static193/solenoid/img/up.png) : as developer, you don't choose what you use. you have to know orm to pass an : interview.
|
q***s 发帖数: 2243 | 5 1. cache
2. convenience for manipulation
【在 d****i 的大作中提到】![](/moin_static193/solenoid/img/up.png) : i'm a newbie. But i heard that orm tends to be too complicated and : convoluted. So i choose simpler and easy one which gives me necessary : functionality. Are there any added benefits of using orm? : : an
|
x****d 发帖数: 1766 | 6 using orm you can get a job. lol
other benefits? just pickup a orm book, 10 mins reading the first chapter,
your are done. better than we explain here for you in hours.
【在 d****i 的大作中提到】![](/moin_static193/solenoid/img/up.png) : i'm a newbie. But i heard that orm tends to be too complicated and : convoluted. So i choose simpler and easy one which gives me necessary : functionality. Are there any added benefits of using orm? : : an
|
r*****s 发帖数: 985 | 7 in general,
hibernate/jpa is not good at handling
1. a large amount data
2. very dynamic
3. complicated data model
4. meta data handling
嗯,还是太抽象了,
有空举例子吧,
或者谁帮我举例子
behaviour
【在 x****d 的大作中提到】![](/moin_static193/solenoid/img/up.png) : I found most developers know a lot about structural aspect of o/r mismatch : but most of them dont know enough about behaviour aspect, like persistent : context, proxy those stuff. : So can you please share with me what are the difficult things when you : working with hibernate? I want to understand if they are due to structural : or behaviour aspect. : The other day I read zhaoce mentioned a bit about that he spends more time : on orm stuff than mvc, maybe he can zkss? : Another thing is mybatis is getting some momentums, what do you guys think : about it? My understand is that developer don't like to deal with behaviour
|
g*****g 发帖数: 34805 | 8 The point of ORM is that you need an ORM one way or another.
Data is stored as relational data in DB and you need to operate on objects
instead in service level. There has to be an bridge in between, what we
typically call data access objects.
You can reinvent your own wheel or you can leverage an ORM framework to save
some boiler plate code. Personally I found spring data with JPA very neat.
Now here is the catch, ORM can get overwhelming complicated by itself at
times. If you find you are stuck in those situation, you can always use a
mixed approach. Keep the simple things with ORM, which does it very well.
And leave the more complicated ones to hand-written SQL. |
x****d 发帖数: 1766 | 9 歪楼啦!!!!!!!!!
咱不讨论要不要ORM行么?假设ORM是必须的。
怪我没说清楚。我想知道我们工作中遇到的困难是哪个方面的。我个人经验是很多程序
员的所谓困难是因为对 behaviour aspect of ORM 的理解不够,所以会觉得困难。我
的看法对么? |
e******0 发帖数: 291 | 10 包了太多层了,有时候很简单的东西都搞不清ORM是怎么处理的, 复杂的东西估计更加...
记得最开始玩JPA, em.flush完了,但是没看到数据库立即更新, 但Transaction.commit
()一定会更新, 蛋疼的厉害 |
|
|
x****d 发帖数: 1766 | 11 哈哈,那我说的对了? 我就是发现很多程序猿只会甚至很精通mapping,对behaviour
aspect的东西不理解。我也是这么过来的。哈哈。不理解肯定蛋痛呀。
...
commit
【在 e******0 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 包了太多层了,有时候很简单的东西都搞不清ORM是怎么处理的, 复杂的东西估计更加... : 记得最开始玩JPA, em.flush完了,但是没看到数据库立即更新, 但Transaction.commit : ()一定会更新, 蛋疼的厉害
|
x****d 发帖数: 1766 | 12 理论上em.flush 和 Transaction.commit是一样的效果。你后来知道为啥了? 我还真
不知道有这样的事。但这个绝不是mapping搞好能解决的,对吧。
...
commit
【在 e******0 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 包了太多层了,有时候很简单的东西都搞不清ORM是怎么处理的, 复杂的东西估计更加... : 记得最开始玩JPA, em.flush完了,但是没看到数据库立即更新, 但Transaction.commit : ()一定会更新, 蛋疼的厉害
|
e******0 发帖数: 291 | 13 网上是说flushing is only issuing the pending sql to the database so that it
is visiable for the current transaction.我没法验证
最近升级java7也带来了类似的cache的问题, 号称performance提升了10%, 但是给我们
带来了JDBC的bug. 应该是为了效率, JDBC后台commit的时候有顺序的变动和延迟, 导
致写进数据库的时候不是预定顺序, 几万年没人碰的legacy code也出了几个蛋疼的bug
...
【在 x****d 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 理论上em.flush 和 Transaction.commit是一样的效果。你后来知道为啥了? 我还真 : 不知道有这样的事。但这个绝不是mapping搞好能解决的,对吧。 : : ... : commit
|
x****d 发帖数: 1766 | 14 我刚才搜了一下,一个可接受的解释是em.flush 是 implementation dependent。也就
是说 hibernate 选择了不动 database 直到 commit。
it
bug
【在 e******0 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 网上是说flushing is only issuing the pending sql to the database so that it : is visiable for the current transaction.我没法验证 : 最近升级java7也带来了类似的cache的问题, 号称performance提升了10%, 但是给我们 : 带来了JDBC的bug. 应该是为了效率, JDBC后台commit的时候有顺序的变动和延迟, 导 : 致写进数据库的时候不是预定顺序, 几万年没人碰的legacy code也出了几个蛋疼的bug : ...
|
z****e 发帖数: 54598 | 15 主要是把hibernate跟cloud结合起来的时候
我被一堆的jboss config files给绕晕了
关键是jpa和jta很多东西,其实对于很多时候,是完全不重要的
没有必要搞这些东西,orm本身意义很大,但是非要上transaction不可
如果不上就不让insert,这就滑稽了
相比之下,nosql容易搞多了,理解了概念,连上去
很少遇到这种事 |
z****e 发帖数: 54598 | 16 transaction固然重要,但是对于次重要的数据
其实没有必要非上不可,一定要弄上transaction反而使得安装很繁琐复杂
这点上nosql除了不能跑sql以外,其实并不比db复杂 |
x****d 发帖数: 1766 | 17 never work with nosql, hehe... but I see your point, and I can feel your
pain too. hehe.
【在 z****e 的大作中提到】![](/moin_static193/solenoid/img/up.png) : transaction固然重要,但是对于次重要的数据 : 其实没有必要非上不可,一定要弄上transaction反而使得安装很繁琐复杂 : 这点上nosql除了不能跑sql以外,其实并不比db复杂
|
s******e 发帖数: 493 | 18 mybatis or ibatis?
behaviour
【在 x****d 的大作中提到】![](/moin_static193/solenoid/img/up.png) : I found most developers know a lot about structural aspect of o/r mismatch : but most of them dont know enough about behaviour aspect, like persistent : context, proxy those stuff. : So can you please share with me what are the difficult things when you : working with hibernate? I want to understand if they are due to structural : or behaviour aspect. : The other day I read zhaoce mentioned a bit about that he spends more time : on orm stuff than mvc, maybe he can zkss? : Another thing is mybatis is getting some momentums, what do you guys think : about it? My understand is that developer don't like to deal with behaviour
|
x****d 发帖数: 1766 | 19 mybatis
【在 s******e 的大作中提到】![](/moin_static193/solenoid/img/up.png) : mybatis or ibatis? : : behaviour
|