nansmallgong's recent timeline updates
nansmallgong

nansmallgong

V2EX member #187627, joined on 2016-08-18 15:25:14 +08:00
  •   The specified image does not exist
    nansmallgong's recent replies
    Aug 30, 2016
    Replied to a topic by eightqueen › Java › spring data jpa 到底好在哪?
    1.service 层用 @Transactional ,从 repository 读取的 entity 处于跟踪态,当方法结束, entity 的变更自动同步到数据库,不需要再调用 save 方法
    2.save 方法本身会根据 id 来判断是执行 insert 或者 update
    3.“操控性差,不能写 sql , hql ” : repository 层,使用 @Query 注解,@Query("这里写 hql"), @Query("这里写 sql",native=true)

    以上。。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1484 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 13ms · UTC 18:13 · PVG 02:13 · LAX 10:13 · JFK 13:13
    ♥ Do have faith in what you're doing.