由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - difficult things working with hibernate
相关主题
谁给推荐一个简单的ORM吧现在的工作完全不用spring,hibernate,以后跳槽是不是会显得很弱?
JDBC搞不懂为什么hibernate为什么这么流行?
现在 Java Web 开发过时了么?hibernate 的两个问题
hibernate和jdbc的比较。Hibernate的优势具体体现在哪里?
问问java认证Java的DAO层哪个框架用的比较多?mybatis有人用吗?
Java GC 为什么不能自动释放jdbc connection?Criticism of Java Persistence Frameworks
求OpenShift上Spring-quickstart的mysql配置方法spring transaction的问题
hibernate和ejb3云计算如何应用到传统的web server应用
相关话题的讨论汇总
话题: orm话题: behaviour话题: aspect话题: hibernate话题: mybatis
进入Java版参与讨论
1 (共1页)
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 的大作中提到】
: 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 的大作中提到】
: 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 的大作中提到】
: 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 的大作中提到】
: 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 的大作中提到】
: 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 的大作中提到】
: 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
()一定会更新, 蛋疼的厉害
相关主题
Java GC 为什么不能自动释放jdbc connection?现在的工作完全不用spring,hibernate,以后跳槽是不是会显得很弱?
求OpenShift上Spring-quickstart的mysql配置方法搞不懂为什么hibernate为什么这么流行?
hibernate和ejb3hibernate 的两个问题
进入Java版参与讨论
x****d
发帖数: 1766
11
哈哈,那我说的对了? 我就是发现很多程序猿只会甚至很精通mapping,对behaviour
aspect的东西不理解。我也是这么过来的。哈哈。不理解肯定蛋痛呀。

...
commit

【在 e******0 的大作中提到】
: 包了太多层了,有时候很简单的东西都搞不清ORM是怎么处理的, 复杂的东西估计更加...
: 记得最开始玩JPA, em.flush完了,但是没看到数据库立即更新, 但Transaction.commit
: ()一定会更新, 蛋疼的厉害

x****d
发帖数: 1766
12
理论上em.flush 和 Transaction.commit是一样的效果。你后来知道为啥了? 我还真
不知道有这样的事。但这个绝不是mapping搞好能解决的,对吧。

...
commit

【在 e******0 的大作中提到】
: 包了太多层了,有时候很简单的东西都搞不清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 的大作中提到】
: 理论上em.flush 和 Transaction.commit是一样的效果。你后来知道为啥了? 我还真
: 不知道有这样的事。但这个绝不是mapping搞好能解决的,对吧。
:
: ...
: commit

x****d
发帖数: 1766
14
我刚才搜了一下,一个可接受的解释是em.flush 是 implementation dependent。也就
是说 hibernate 选择了不动 database 直到 commit。

it
bug

【在 e******0 的大作中提到】
: 网上是说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 的大作中提到】
: transaction固然重要,但是对于次重要的数据
: 其实没有必要非上不可,一定要弄上transaction反而使得安装很繁琐复杂
: 这点上nosql除了不能跑sql以外,其实并不比db复杂

s******e
发帖数: 493
18
mybatis or ibatis?

behaviour

【在 x****d 的大作中提到】
: 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 的大作中提到】
: mybatis or ibatis?
:
: behaviour

1 (共1页)
进入Java版参与讨论
相关主题
云计算如何应用到传统的web server应用问问java认证
我来说一下什么是烂技术吧,补充一下是从找工作混饭角度。Java GC 为什么不能自动释放jdbc connection?
自己做J2EE项目,请前辈提些建议,谢谢求OpenShift上Spring-quickstart的mysql配置方法
Anybody evaluated/used javalite?hibernate和ejb3
谁给推荐一个简单的ORM吧现在的工作完全不用spring,hibernate,以后跳槽是不是会显得很弱?
JDBC搞不懂为什么hibernate为什么这么流行?
现在 Java Web 开发过时了么?hibernate 的两个问题
hibernate和jdbc的比较。Hibernate的优势具体体现在哪里?
相关话题的讨论汇总
话题: orm话题: behaviour话题: aspect话题: hibernate话题: mybatis