Search in sources :

Example 1 with AbstractDao

use of org.greenrobot.greendao.AbstractDao in project greenDAO by greenrobot.

the class QueryBuilder method join.

/**
     * Expands the query to another entity type by using a JOIN. The given sourceProperty is used to match the primary
     * key property of the given destinationEntity.
     */
public <J> Join<T, J> join(Property sourceProperty, Class<J> destinationEntityClass) {
    AbstractDao<J, ?> destinationDao = (AbstractDao<J, ?>) dao.getSession().getDao(destinationEntityClass);
    Property destinationProperty = destinationDao.getPkProperty();
    return addJoin(tablePrefix, sourceProperty, destinationDao, destinationProperty);
}
Also used : AbstractDao(org.greenrobot.greendao.AbstractDao) Property(org.greenrobot.greendao.Property)

Aggregations

AbstractDao (org.greenrobot.greendao.AbstractDao)1 Property (org.greenrobot.greendao.Property)1