#2351 - Rename Database.getReference() to reference() with deprecation

This commit is contained in:
rbygrave
2021-09-03 10:50:29 +12:00
parent 57c0bceb63
commit 7c2a77081b
6 changed files with 19 additions and 15 deletions
+10 -4
View File
@@ -658,24 +658,30 @@ public final class DB {
* @param beanType the type of entity bean
* @param id the id value
*/
public static <T> T getReference(Class<T> beanType, Object id) {
public static <T> T reference(Class<T> beanType, Object id) {
return getDefault().reference(beanType, id);
}
/**
* Deprecated migrate to beanId().
*/
@Deprecated
public static <T> T getReference(Class<T> beanType, Object id) {
return reference(beanType, id);
}
/**
* Sort the list using the sortByClause which can contain a comma delimited
* list of property names and keywords asc, desc, nullsHigh and nullsLow.
* <ul>
* <li>asc - ascending order (which is the default)</li>
* <li>desc - Descending order</li>
* <li>nullsHigh - Treat null values as high/large values (which is the
* default)</li>
* <li>nullsHigh - Treat null values as high/large values (which is the default)</li>
* <li>nullsLow- Treat null values as low/very small values</li>
* </ul>
* <p>
* If you leave off any keywords the defaults are ascending order and treating
* nulls as high values.
* </p>
* <p>
* Note that the sorting uses a Comparator and Collections.sort(); and does
* not invoke a DB query.