我使用了境界。但是我遇到了错误。错误:吸气剂未与任何字段关联。你能帮我吗?我已经检查了可用的解决方案。显然,它没有帮助,我无法解决我的问题。我正在使用Realm 0.87.2
package com.app.youtubers.realm.table;
import com.app.youtubers.model.ContentDetails;
import com.app.youtubers.model.Snippet;
import com.app.youtubers.model.Thumbnail;
import com.app.youtubers.model.TypeThumbnail;
import com.app.youtubers.model.Video;
import java.io.Serializable;
import io.realm.RealmObject;
import io.realm.annotations.Ignore;
import io.realm.annotations.PrimaryKey;
import io.realm.annotations.Required;
public class RealmFavorite extends RealmObject implements Serializable {
@PrimaryKey
private String videoId;
private int id;
private String title;
private String description;
private String thumbnail;
public RealmFavorite() {
}
public RealmFavorite(String videoId, int id, String title, String description, String thumbnail) {
this.title = title;
this.description = description;
this.videoId = videoId;
this.id = id;
this.thumbnail = thumbnail;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getVideoId() {
return videoId;
}
public void setVideoId(String videoId) {
this.videoId = videoId;
}
public String getThumbnail() {
return thumbnail;
}
public void setThumbnail(String thumbnail) {
this.thumbnail = thumbnail;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public static Video getVideo(RealmFavorite obj) {
Video video = new Video();
video.snippet = new Snippet();
video.snippet.thumbnails = new Thumbnail();
video.snippet.thumbnails.high = new TypeThumbnail();
video.contentDetails = new ContentDetails();
video.snippet.title = obj.title;
video.snippet.description = obj.description;
video.contentDetails.videoId = obj.videoId;
video.snippet.thumbnails.high.url = obj.thumbnail;
return video;
}
}
错误:error: Getter getId is not associated to any field
我使用了领域。但是我遇到了错误。错误:吸气剂未与任何字段关联。你能帮我吗?谢谢...我已经研究了可用的解决方案。显然,它没有帮助,我无法解决我的问题。我正在使用Realm 0.87.2