package com.braunster.chatsdk.dao;
import com.braunster.chatsdk.dao.DaoSession;
import de.greenrobot.dao.DaoException;
// THIS CODE IS GENERATED BY greenDAO, EDIT ONLY INSIDE THE "KEEP"-SECTIONS
// KEEP INCLUDES - put your custom includes here
import com.braunster.chatsdk.dao.entities.Entity;
// KEEP INCLUDES END
/**
* Entity mapped to table USER_THREAD_LINK.
*/
public class UserThreadLink extends Entity {
private Long id;
private Long BUserDaoId;
private Long BThreadDaoId;
/** Used to resolve relations */
private transient DaoSession daoSession;
/** Used for active entity operations. */
private transient UserThreadLinkDao myDao;
private BUser BUser;
private Long BUser__resolvedKey;
private BThread BThread;
private Long BThread__resolvedKey;
// KEEP FIELDS - put your custom fields here
// KEEP FIELDS END
public UserThreadLink() {
}
public UserThreadLink(Long id) {
this.id = id;
}
public UserThreadLink(Long id, Long BUserDaoId, Long BThreadDaoId) {
this.id = id;
this.BUserDaoId = BUserDaoId;
this.BThreadDaoId = BThreadDaoId;
}
/** called by internal mechanisms, do not call yourself. */
public void __setDaoSession(DaoSession daoSession) {
this.daoSession = daoSession;
myDao = daoSession != null ? daoSession.getUserThreadLinkDao() : null;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Long getBUserDaoId() {
return BUserDaoId;
}
public void setBUserDaoId(Long BUserDaoId) {
this.BUserDaoId = BUserDaoId;
}
public Long getBThreadDaoId() {
return BThreadDaoId;
}
public void setBThreadDaoId(Long BThreadDaoId) {
this.BThreadDaoId = BThreadDaoId;
}
/** To-one relationship, resolved on first access. */
public BUser getBUser() {
Long __key = this.BUserDaoId;
if (BUser__resolvedKey == null || !BUser__resolvedKey.equals(__key)) {
if (daoSession == null) {
throw new DaoException("Entity is detached from DAO context");
}
BUserDao targetDao = daoSession.getBUserDao();
BUser BUserNew = targetDao.load(__key);
synchronized (this) {
BUser = BUserNew;
BUser__resolvedKey = __key;
}
}
return BUser;
}
public void setBUser(BUser BUser) {
synchronized (this) {
this.BUser = BUser;
BUserDaoId = BUser == null ? null : BUser.getId();
BUser__resolvedKey = BUserDaoId;
}
}
/** To-one relationship, resolved on first access. */
public BThread getBThread() {
Long __key = this.BThreadDaoId;
if (BThread__resolvedKey == null || !BThread__resolvedKey.equals(__key)) {
if (daoSession == null) {
throw new DaoException("Entity is detached from DAO context");
}
BThreadDao targetDao = daoSession.getBThreadDao();
BThread BThreadNew = targetDao.load(__key);
synchronized (this) {
BThread = BThreadNew;
BThread__resolvedKey = __key;
}
}
return BThread;
}
public void setBThread(BThread BThread) {
synchronized (this) {
this.BThread = BThread;
BThreadDaoId = BThread == null ? null : BThread.getId();
BThread__resolvedKey = BThreadDaoId;
}
}
/** Convenient call for {@link AbstractDao#delete(Object)}. Entity must attached to an entity context. */
public void delete() {
if (myDao == null) {
throw new DaoException("Entity is detached from DAO context");
}
myDao.delete(this);
}
/** Convenient call for {@link AbstractDao#update(Object)}. Entity must attached to an entity context. */
public void update() {
if (myDao == null) {
throw new DaoException("Entity is detached from DAO context");
}
myDao.update(this);
}
/** Convenient call for {@link AbstractDao#refresh(Object)}. Entity must attached to an entity context. */
public void refresh() {
if (myDao == null) {
throw new DaoException("Entity is detached from DAO context");
}
myDao.refresh(this);
}
// KEEP METHODS - put your custom methods here
// KEEP METHODS END
}