Skip to content

JPA annotations is doesn't work on getter #2216

Closed
@Michael1024-CJX

Description

@Michael1024-CJX

I tried adding @column and @Versioin to the getter, but none of them worked.

@Entity
@Table(name = "contact")
public class ContactEO {
    @Id
    private Integer id;
    private String name;

    @Column(name = "contact_name", nullable = false, length = 512)
    public String getName() {
        return name;
    }
    // other getter setter
}

log output create table sql:
create table contact (id int4 not null, name varchar(255), primary key (id))

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions