2023-06-21-TIL

Today I Learned

UCI

  • https://www.uci.or.kr/?menuno=1
  • http://uci.k-pop.or.kr/search/music
  • https://www.copyright.or.kr/business/uci/index.do

Saving Entity in JPA

  • https://docs.spring.io/spring-data/jpa/docs/current/reference/html/#jpa.entity-persistence.saving-entites

How to Use Custim ID Generation

  • https://spring.io/blog/2021/09/09/spring-data-jdbc-how-to-use-custom-id-generation
  • https://github.com/spring-projects/spring-data-examples/tree/main/jdbc/howto/idgeneration
  • https://thorben-janssen.com/custom-sequence-based-idgenerator/
  • https://yoonbing9.tistory.com/39

Persistable

  • https://stackoverflow.com/questions/26313044/preferred-way-to-implement-persistable-isnew-for-entity-with-predefined-id-in-sp
  • https://docs.spring.io/spring-data/commons/docs/current/api/org/springframework/data/domain/Persistable.html
  • https://leegicheol.github.io/jpa/jpa-is-new/
  • https://catsbi.oopy.io/69a3e741-f165-4046-a6eb-2002143e5dae
  • https://neate.dev/technology/java/2020/04/15/using-persistable-for-jpa-performance-improvements.html
  • https://thorben-janssen.com/spring-data-jpa-state-detection/
  • https://jaime-note.tistory.com/65
  • https://thorben-janssen.com/spring-data-jpa-state-detection/

SharedSessionContractImplementor

  • https://docs.jboss.org/hibernate/orm/5.2/javadocs/org/hibernate/engine/spi/SharedSessionContractImplementor.html
  • https://docs.jboss.org/hibernate/orm/current/javadocs/org/hibernate/engine/spi/SharedSessionContractImplementor.html
  • https://javadoc.io/static/org.hibernate/hibernate-core/5.4.9.Final/org/hibernate/engine/spi/SharedSessionContractImplementor.html

@Transient

  • https://gmoon92.github.io/jpa/2019/09/29/what-is-the-transient-annotation-used-for-in-jpa.html
  • https://stackoverflow.com/questions/2154622/why-does-jpa-have-a-transient-annotation
  • https://www.baeldung.com/jpa-transient-ignore-field

IdentifierGenerator

  • https://techblog.woowahan.com/2607/

How to Inject Spring Bean into Entity

엔티티 자체가 빈으로 등록되는게 아니므로 강제로 DB 커넥션에 대한 세션을 얻어와서 쿼리를 실행시켜야 한다. 하지만 이는 JPA의 영속계층에 대한 보호를 받지 못한다. 따라서 엔티티 안에서는 쿼리를 사용하지 않는 것이 좋다.

  • https://www.baeldung.com/spring-inject-bean-into-unmanaged-objects
  • https://stackoverflow.com/questions/12742826/how-do-i-know-the-id-before-saving-an-object-in-jpa