address.java

来自「Hibernate基础教程一书源码.Hibernate是一个持久层开源框架」· Java 代码 · 共 50 行

JAVA
50
字号
package com.hibernatebook.annotations;

import javax.persistence.*;

@Entity
public class Address {
    private int id;
    private String city;
    private String country;

    // Constructors...

    protected Address() {
    }
    
    public Address(String city, String country) {
        this.city = city;
        this.country = country;
    }
    
    // Getters...

    @Id
    public int getId() {
        return id;
    }

    public String getCity() {
        return city;
    }

    public String getCountry() {
        return country;
    }
    
    // Setters...

    public void setId(int id) {
        this.id = id;
    }
    
    public void setCity(String city) {
        this.city = city;
    }

    public void setCountry(String country) {
        this.country = country;
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?