P E N C I L
Login
Entity declaration
  1. @OneToOne(fetch = FetchType.LAZY)
    @JoinColumn(name='MY_COLUMN_NAME', referencedColumnName='DESTINTAION_COLUMN_NAME', insertable = false, updatable = false)
    privat OtherEntity entity

  2. @JoinColumn(name = "columnoftablewhichcontainthisannotation")

  3. @Column(name = "STATUS")
    @Convert(converter = CardStatusConverter.class)
    private CardStatus status;


  4. @Entity
    @Table(name="MyTable")
    class A {
    }

  5. Identifier
    https://www.thoughts-on-java.org/jpa-generate-primary-keys/
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "book_generator")
    @SequenceGenerator(name="book_generator", sequenceName = "book_seq", allocationSize=50)
    int id;

    1. Auto increase
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)



    1. strategy AUTO: default - by provider (integer: automatically increase: how ???)

    2. strategy TABLE : use a table to store 'default' next value

    3. strategy IDENTITY: generate SQL with value = 'defaut'. It's DBMS which generate value