DLSearch { public String addAlias( final String path ) { return addAlias(path, JoinType.INNER_JOIN); } DLSearch( final int rowCount, final int firstRow );  DLSearch();  DLSearch( final List<DLSort> sorts );  DLSearch( final List<DLSort> sorts, final int rowCount, final int firstRow );  DLSearch( final List<DLSort> sorts, final int rowCount, final int firstRow, Class<T> persistentClass ); void clearFilterCriterions(); void addFilterCriterions( final List<Criterion> criterions ); void addFilterCriterion( final Criterion criterion ); void removeFilterCriterions( final Criterion criterion ); int getFirstRow(); void setFirstRow( final int firstRow ); int getRowCount(); void setRowCount( final int rowCount ); Iterator<DLSort> getSorts(); void setSorts( final List<DLSort> sorts ); void addSort( final DLSort sort ); void addSort( final String column ); void clearSorts(); Collection<Criterion> getCriterions(); CacheMode getCacheMode(); void setCacheMode(CacheMode cacheMode); String addAliases( final String fullPath ); String addAliases( final String fullPath, final JoinType joinType ); void addFetch( final String ... paths); void addFetches( final String ... fullPaths); String addAlias( final String path ); String addAlias( final String path, JoinType joinType ); void addAlias( final String path, final String alias ); Alias addAlias( final String path, final String alias, final JoinType joinType ); Alias getAlias(final String alias); Alias getAliasForPath(final String path); String getAliasForFullPath(final String fullPath); String[] parsePath( final String fullPath ); Set<Alias> getAliases(); void addProjection( final Projection projection ); Collection<Projection> getProjections(); boolean isEmbeddableField(Class clazz, String property); String addAliasesForProperty(String pathWithProperty); String addAliasesForProperty(String pathWithProperty, JoinType joinType); boolean isDistinct(); void setDistinct( final boolean distinct ); @Deprecated void addAlias( final String path, final String alias, final int joinType ); @Deprecated void addAlias( final String path, final int joinType ); @Override String toString();  }
@Test(expected = IllegalArgumentException.class) public void testAddAliasWithEntityClassUnknownProperty() throws Exception { DLSearch<Entity> dlSearch = new DLSearch<Entity>(Collections.<DLSort>emptyList(), 10, 0, Entity.class); assertEquals("unknown property should fail", "unknownAlias", dlSearch.addAlias("unknown")); }