Search in sources :

Example 1 with SimpleGroup

use of io.jans.orm.sql.model.SimpleGroup in project jans by JanssenProject.

the class SqlSimpleGroupSample method main.

public static void main(String[] args) {
    // Prepare sample connection details
    SqlEntryManagerSample sqlEntryManagerSample = new SqlEntryManagerSample();
    // Create SQL entry manager
    SqlEntryManager sqlEntryManager = sqlEntryManagerSample.createSqlEntryManager();
    String personDN = "inum=ae8c7ff9-def7-4b42-8147-de8380617a37,ou=people,o=gluu";
    Filter ownerFilter = Filter.createEqualityFilter("owner", personDN);
    Filter memberFilter = Filter.createEqualityFilter("member", personDN);
    Filter searchFilter = Filter.createORFilter(ownerFilter, memberFilter);
    List<SimpleGroup> result = sqlEntryManager.findEntries("ou=groups,o=gluu", SimpleGroup.class, searchFilter, 1);
    System.out.println(result);
}
Also used : Filter(io.jans.orm.search.filter.Filter) SimpleGroup(io.jans.orm.sql.model.SimpleGroup) SqlEntryManagerSample(io.jans.orm.sql.persistence.SqlEntryManagerSample) SqlEntryManager(io.jans.orm.sql.impl.SqlEntryManager)

Aggregations

Filter (io.jans.orm.search.filter.Filter)1 SqlEntryManager (io.jans.orm.sql.impl.SqlEntryManager)1 SimpleGroup (io.jans.orm.sql.model.SimpleGroup)1 SqlEntryManagerSample (io.jans.orm.sql.persistence.SqlEntryManagerSample)1