Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

您好,请问如何持久化Gson生成的,带有InnerClass的entity? #3

Open
jesse920524 opened this issue Nov 16, 2016 · 0 comments
Open

Comments

@jesse920524
Copy link

实体类如下,专辑类持有内部类歌曲的List,请问如何将List通过GreenDao持久化?感激不尽.

@entity
public class Album {

@Id
private Long id;


private String name;
private String artist;
private List<Song> songList;

@Generated(hash = 1988454030)
public Album(Long id, String name, String artist) {
    this.id = id;
    this.name = name;
    this.artist = artist;
}

@Generated(hash = 1609191978)
public Album() {
}



@Entity
class Song{
    @Id
    private Long id;

    @Unique
    private Integer num;


    private String albumName;

    @NotNull
    @Unique
    private String name;
    private String time;
}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant