Android Open Source - EnklawaPlayer Thread Scope

From Project

Back to project page EnklawaPlayer.


The source code is released under:

GNU General Public License

If you think the Android project EnklawaPlayer listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package macbury.pod.db.scopes;
//from w  w w.  ja  va  2 s.  co m
import com.j256.ormlite.dao.Dao;
import com.j256.ormlite.stmt.QueryBuilder;

import java.sql.SQLException;

import macbury.pod.api.APIThread;
import macbury.pod.db.models.ForumThread;

 * Created by macbury on 12.09.14.
public class ThreadScope extends AbstractScope<ForumThread> {
  public ThreadScope(Dao<ForumThread, Integer> dao) {

  public ForumThread buildFromApi(APIThread apiObject) {
    ForumThread thread     = new ForumThread();
    thread.title           = apiObject.title;
    thread.content         = apiObject.content;            =;
    thread.pubDate         = apiObject.pub_date;
    return thread;

  public ForumThread find(APIThread apiObject) {
    QueryBuilder<ForumThread, Integer> builder = dao.queryBuilder();
    try {
      return builder.queryForFirst();
    } catch (SQLException e) {
      return null;

  public void afterCreate(ForumThread model) {


  public void afterDestroy(ForumThread object) {


  public void afterSave(ForumThread object) {


Java Source Code List