'can't add type ColumnInfo database with references to other class

Hi i'm new to android and i have a problem. I can't add type Terminous ColumnInfo into database. The class constructor Line, has a reference to another class called Terminus. My code is:

@Entity
public class Line{
 @ColumnInfo(name = "station")
    private Terminous x;
    @PrimaryKey
    @NonNull
    private Terminous y;
    Line(Terminous x, Terminous y) {
        this.x = x;
        this.y = y;
    }
}

And Terminus class is:

public class Terminous {
    private String station;
    private String did;

    Terminous(String station,String did) {
        this.station = station;
        this.did= did;

    }
}

Why type ColumnInfo(name="station") can't be Terminus type?How can i make database?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source