亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

java - 數(shù)據(jù)庫一條記錄為什么經(jīng)過hibernate查詢變成一個(gè)對象了呢??
阿神
阿神 2017-04-18 10:56:07
0
5
846

今天面試問到了這個(gè)問題,他的意思是讓剖析源碼嗎??突然感覺到好奇怪,,ORM框架,不就是這樣的嗎??求大神解釋。謝了

阿神
阿神

閉關(guān)修行中......

reply all(5)
黃舟

I was too hasty to answer questions when I left the house in the morning. Now let’s talk about it in detail. Two points can be mentioned here:

  • Persistence

  • Deserialization

So PersistenceEveryone downstairs has mentioned that an object is saved to the storage system. In the case you mentioned, it is saved to the database. Then each attribute is generally used as a field, and then the value is saved as a record.

Then deserialization. The connection to the database is established through socket, so there is no doubt that it has gone through the network. If you need to transmit an object on the network, you must serialize it. In other words: The deserialization process has been completed when the ResultSet is obtained through the database link.

迷茫

So first use sql and see how to use the original jdbc, and you will know why there is this framework

PHPzhong

Generally, it is easier for interviewers to ask questionsJDBC就到底了吧,所以@泊浮目 所說的反序列化我覺得不是面試官的意思。用原生的JDBC執(zhí)行SQL可以拿到ResultSet對象,框架不過是從里面取一個(gè)個(gè)字段值,然后封裝到一個(gè)對象中而已。我的理解就是這樣,也確實(shí)沒看過這種ORM的源碼,雖然我用Mybatis.

Peter_Zhu

This has nothing to do with deserialization.
The original JDBC query results in a ResultSet. Hibernate knows the correspondence between the fields and object properties in the ResultSet through xml configuration or Anotation, and then generates POJO objects through the reflection mechanism.

大家講道理

What a coincidence. Sixteen hours after you posted the question, I was asked the same question in the interview.
My answer was basically the same as @Xing Aiming’s answer to this question. But looking at the reaction, I felt it was not what the interviewer wanted.
Personally, I think this kind of question is quite strange. The main reason is that I can’t get the specific aspect I want to assess.

There is another question. I checked several times to make sure I heard it correctly, but I still don’t understand what it is..
What is the difference between jquery ${} and #{}? Pay attention to the curly brackets..

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template