#2349 - Rename Database.getBeanId() to beanId() with deprecation

This commit is contained in:
rbygrave
2021-09-03 09:31:16 +12:00
parent 0ed6ccf499
commit a5f9beabdf
7 changed files with 29 additions and 13 deletions
+1 -1
View File
@@ -1239,7 +1239,7 @@ public final class DB {
* Return the value of the Id property for a given bean.
*/
public static Object getBeanId(Object bean) {
return getDefault().getBeanId(bean);
return getDefault().beanId(bean);
}
/**
+18 -2
View File
@@ -248,7 +248,15 @@ public interface Database {
/**
* Return the value of the Id property for a given bean.
*/
Object getBeanId(Object bean);
Object beanId(Object bean);
/**
* Deprecated migrate to beanId().
*/
@Deprecated
default Object getBeanId(Object bean) {
return beanId(bean);
}
/**
* Set the Id value onto the bean converting the type of the id value if necessary.
@@ -260,7 +268,15 @@ public interface Database {
* @param bean The entity bean to set the id value on.
* @param id The id value to set.
*/
Object setBeanId(Object bean, Object id);
Object beanId(Object bean, Object id);
/**
* Deprecated migrate to beanId().
*/
@Deprecated
default Object setBeanId(Object bean, Object id) {
return beanId(bean, id);
}
/**
* Return a map of the differences between two objects of the same type.