Created
May 14, 2018 22:26
Star
You must be signed in to star a gist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@BindType("item") | |
@BindXmlType(namespaces={ | |
@BindXmlNamespace(prefix="dc",uri="http://purl.org/dc/elements/1.1/"), | |
@BindXmlNamespace(prefix="content",uri="http://purl.org/dc/elements/1.1/"), | |
}) | |
@BindSqlType(name = "articles") | |
public class Article extends Entity { | |
public String title; | |
public String description; | |
public URL link; | |
public String author; | |
@BindSqlColumn(nullable = false, columnType = ColumnType.UNIQUE) | |
public String guid; | |
public URL comments; | |
@BindSqlColumn(parentEntity = Channel.class) | |
public long channelId; | |
@Bind("thumbnail") | |
@BindXml(namespace="media") | |
public Thumbnail thumbnail; | |
public boolean read; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@BindType | |
@BindSqlType(name="channels") | |
public class Channel extends Entity { | |
public String title; | |
@BindSqlColumn(columnType = ColumnType.UNIQUE) | |
public String link; | |
public String description; | |
public String language; | |
public String copyright; | |
@BindAdapter(adapter = DateAdapter.class) | |
public Date pubDate; | |
@BindAdapter(adapter = DateAdapter.class) | |
public Date lastBuildDate; | |
public Image image; | |
@BindSqlColumn(parentEntity = RssFeed.class) | |
public long rssFeedId; | |
@Bind("item") | |
@BindSqlRelation(foreignKey = "channelId") | |
public List<Article> articles; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@BindType | |
public class Image { | |
public String url; | |
public String title; | |
public String link; | |
public int width = 88; | |
public int height = 31; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@BindType(value="rss") | |
public class RssFeed extends Entity { | |
@BindSqlColumn(columnType = ColumnType.UNIQUE) | |
public String uid; | |
@BindXml(xmlType = XmlType.ATTRIBUTE) | |
public String version; | |
@Bind("channel") | |
@BindSqlRelation(foreignKey = "rssFeedId") | |
public List<Channel> channels; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@BindType | |
public class Thumbnail { | |
@BindXml(xmlType = XmlType.ATTRIBUTE) | |
public long width; | |
@BindXml(xmlType = XmlType.ATTRIBUTE) | |
public long height; | |
@BindXml(xmlType = XmlType.ATTRIBUTE) | |
public URL url; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment