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 CONTACT_LINK.
*/
public class ContactLink extends Entity {
private Long id;
private Long BUserDaoId;
private Long linkOwnerBUserDaoId;
/** Used to resolve relations */
private transient DaoSession daoSession;
/** Used for active entity operations. */
private transient ContactLinkDao myDao;
private BUser BUser;
private Long BUser__resolvedKey;
private BUser linkOwnerBUser;
private Long linkOwnerBUser__resolvedKey;
// KEEP FIELDS - put your custom fields here
// KEEP FIELDS END
public ContactLink() {
}
public ContactLink(Long id) {
this.id = id;
}
public ContactLink(Long id, Long BUserDaoId, Long linkOwnerBUserDaoId) {
this.id = id;
this.BUserDaoId = BUserDaoId;
this.linkOwnerBUserDaoId = linkOwnerBUserDaoId;
}
/** called by internal mechanisms, do not call yourself. */
public void __setDaoSession(DaoSession daoSession) {
this.daoSession = daoSession;
myDao = daoSession != null ? daoSession.getContactLinkDao() : 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 getLinkOwnerBUserDaoId() {
return linkOwnerBUserDaoId;
}
public void setLinkOwnerBUserDaoId(Long linkOwnerBUserDaoId) {
this.linkOwnerBUserDaoId = linkOwnerBUserDaoId;
}
/** 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 BUser getLinkOwnerBUser() {
Long __key = this.linkOwnerBUserDaoId;
if (linkOwnerBUser__resolvedKey == null || !linkOwnerBUser__resolvedKey.equals(__key)) {
if (daoSession == null) {
throw new DaoException("Entity is detached from DAO context");
}
BUserDao targetDao = daoSession.getBUserDao();
BUser linkOwnerBUserNew = targetDao.load(__key);
synchronized (this) {
linkOwnerBUser = linkOwnerBUserNew;
linkOwnerBUser__resolvedKey = __key;
}
}
return linkOwnerBUser;
}
public void setLinkOwnerBUser(BUser linkOwnerBUser) {
synchronized (this) {
this.linkOwnerBUser = linkOwnerBUser;
linkOwnerBUserDaoId = linkOwnerBUser == null ? null : linkOwnerBUser.getId();
linkOwnerBUser__resolvedKey = linkOwnerBUserDaoId;
}
}
/** 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
}