Redian新闻
>
difficult things working with hibernate
avatar
difficult things working with hibernate# Java - 爪哇娇娃
b*6
1
我的一个朋友和美裔华人结婚,她在国内,申请移民签证被拒,请求这里达人帮助。万
分感谢!如果您能帮助成功,必定当面答谢!
下面是她的签证情况,有点长。
我们2007年的4月份结婚,我的先生回到美国后,5月份在纽约申请的k3和cr1,8月来到
广州面试,最后要求补充资料。
当时给我面试的是一个中长卷发的白人女性,她给我的感觉非常严肃。
她问我“你们是是什么时候认识的?”
我说“2006年3月份”
面试官问:“你们怎么认识的?”
我说:“上网上认识的。”
面试官问:“你知道他是做什么的吗”
“做贸易助理。”
“他的收入是多少。”
“年薪39000。”
“你有他的护照吗?”
“有复印件。”因为领事馆要求准备的资料我全部都准备了,但是我找了我的包裹发现
我没有,于是我就和她说“不好意思,我可能忘记带来了。”但是时候我才发现领事馆
根本没有要求我准备配偶的护照复印件。后来她瞄见了我摆在玻璃板外面的我老公的香
港护照复印件,她说:“那不就是护照吗?”我说:“那是我老公的香港护照,因为他
也是香港人。你需要看吗?”她说:“不需要。”我就没有给她。
她接着问:“你老公是什么时候移民美国的?”这个问题我当
avatar
x*d
2
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?
avatar
c*5
3
见面次数太少了。。才3次。。=_=
avatar
d*i
4
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

avatar
x*d
5
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

avatar
d*i
6
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.

avatar
q*s
7
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

avatar
x*d
8
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

avatar
r*s
9
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

avatar
g*g
10
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.
avatar
x*d
11
歪楼啦!!!!!!!!!
咱不讨论要不要ORM行么?假设ORM是必须的。
怪我没说清楚。我想知道我们工作中遇到的困难是哪个方面的。我个人经验是很多程序
员的所谓困难是因为对 behaviour aspect of ORM 的理解不够,所以会觉得困难。我
的看法对么?
avatar
e*0
12
包了太多层了,有时候很简单的东西都搞不清ORM是怎么处理的, 复杂的东西估计更加...
记得最开始玩JPA, em.flush完了,但是没看到数据库立即更新, 但Transaction.commit
()一定会更新, 蛋疼的厉害
avatar
x*d
13
哈哈,那我说的对了? 我就是发现很多程序猿只会甚至很精通mapping,对behaviour
aspect的东西不理解。我也是这么过来的。哈哈。不理解肯定蛋痛呀。

...
commit

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

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

...
commit

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

avatar
e*0
15
网上是说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

avatar
x*d
16
我刚才搜了一下,一个可接受的解释是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
: ...

avatar
z*e
17
主要是把hibernate跟cloud结合起来的时候
我被一堆的jboss config files给绕晕了
关键是jpa和jta很多东西,其实对于很多时候,是完全不重要的
没有必要搞这些东西,orm本身意义很大,但是非要上transaction不可
如果不上就不让insert,这就滑稽了
相比之下,nosql容易搞多了,理解了概念,连上去
很少遇到这种事
avatar
z*e
18
transaction固然重要,但是对于次重要的数据
其实没有必要非上不可,一定要弄上transaction反而使得安装很繁琐复杂
这点上nosql除了不能跑sql以外,其实并不比db复杂
avatar
x*d
19
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复杂

avatar
s*e
20
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

avatar
x*d
21
mybatis

【在 s******e 的大作中提到】
: mybatis or ibatis?
:
: behaviour

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。