mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-10-23 03:22:59 +00:00
Remove deprecated methods in ebean-api - meta, metric, plugin. Migrate getFoo() -> foo()
These methods are deprecated getters, migrate to the associated accessor method.
This commit is contained in:
@@ -10,11 +10,4 @@ public interface MetaCountMetric extends MetaMetric {
|
||||
*/
|
||||
long count();
|
||||
|
||||
/**
|
||||
* Migrate to count()
|
||||
*/
|
||||
@Deprecated
|
||||
default long getCount() {
|
||||
return count();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,11 +10,4 @@ public interface MetaMetric {
|
||||
*/
|
||||
String name();
|
||||
|
||||
/**
|
||||
* Migrate to name().
|
||||
*/
|
||||
@Deprecated
|
||||
default String getName() {
|
||||
return name();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,40 +10,16 @@ public interface MetaQueryMetric extends MetaTimedMetric {
|
||||
*/
|
||||
Class<?> type();
|
||||
|
||||
/**
|
||||
* Migrate to type().
|
||||
*/
|
||||
@Deprecated
|
||||
default Class<?> getType() {
|
||||
return type();
|
||||
}
|
||||
|
||||
/**
|
||||
* The label for the query (can be null).
|
||||
*/
|
||||
String label();
|
||||
|
||||
/**
|
||||
* Migrate to label().
|
||||
*/
|
||||
@Deprecated
|
||||
default String getLabel() {
|
||||
return label();
|
||||
}
|
||||
|
||||
/**
|
||||
* The actual SQL of the query.
|
||||
*/
|
||||
String sql();
|
||||
|
||||
/**
|
||||
* Migrate to sql().
|
||||
*/
|
||||
@Deprecated
|
||||
default String getSql() {
|
||||
return sql();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the hash of the plan.
|
||||
*/
|
||||
|
||||
@@ -11,67 +11,26 @@ public interface MetaTimedMetric extends MetaMetric {
|
||||
*/
|
||||
String location();
|
||||
|
||||
/**
|
||||
* Migrate to location()
|
||||
*/
|
||||
@Deprecated
|
||||
default String getLocation() {
|
||||
return location();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the total count.
|
||||
*/
|
||||
long count();
|
||||
|
||||
/**
|
||||
* Migrate to count()
|
||||
*/
|
||||
@Deprecated
|
||||
default long getCount() {
|
||||
return count();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the total execution time in micros.
|
||||
*/
|
||||
long total();
|
||||
|
||||
/**
|
||||
* Migrate to total()
|
||||
*/
|
||||
@Deprecated
|
||||
default long getTotal() {
|
||||
return total();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the max execution time in micros.
|
||||
*/
|
||||
long max();
|
||||
|
||||
/**
|
||||
* Migrate to max()
|
||||
*/
|
||||
@Deprecated
|
||||
default long getMax() {
|
||||
return max();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the mean execution time in micros.
|
||||
*/
|
||||
long mean();
|
||||
|
||||
|
||||
/**
|
||||
* Migrate to mean()
|
||||
*/
|
||||
@Deprecated
|
||||
default long getMean() {
|
||||
return mean();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if this is the first metrics collection for this query.
|
||||
* <p>
|
||||
|
||||
@@ -12,37 +12,14 @@ public interface ServerMetrics {
|
||||
*/
|
||||
List<MetaTimedMetric> timedMetrics();
|
||||
|
||||
/**
|
||||
* Migrate to timedMetrics().
|
||||
*/
|
||||
@Deprecated
|
||||
default List<MetaTimedMetric> getTimedMetrics() {
|
||||
return timedMetrics();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the query metrics.
|
||||
*/
|
||||
List<MetaQueryMetric> queryMetrics();
|
||||
|
||||
/**
|
||||
* Migrate to queryMetrics().
|
||||
*/
|
||||
@Deprecated
|
||||
default List<MetaQueryMetric> getQueryMetrics() {
|
||||
return queryMetrics();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the Counter metrics.
|
||||
*/
|
||||
List<MetaCountMetric> countMetrics();
|
||||
|
||||
/**
|
||||
* Migrate to countMetrics().
|
||||
*/
|
||||
@Deprecated
|
||||
default List<MetaCountMetric> getCountMetrics() {
|
||||
return countMetrics();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,14 +12,6 @@ public interface QueryPlanMetric {
|
||||
*/
|
||||
TimedMetric metric();
|
||||
|
||||
/**
|
||||
* Deprecated migrate to metric().
|
||||
*/
|
||||
@Deprecated
|
||||
default TimedMetric getMetric() {
|
||||
return metric();
|
||||
}
|
||||
|
||||
/**
|
||||
* Visit the underlying metric.
|
||||
*/
|
||||
|
||||
@@ -16,28 +16,12 @@ public interface BeanDocType<T> {
|
||||
/**
|
||||
* Return the doc store index type for this bean type.
|
||||
*/
|
||||
default String indexType() {
|
||||
return getIndexType();
|
||||
}
|
||||
|
||||
/**
|
||||
* Deprecated migrate to indexType().
|
||||
*/
|
||||
@Deprecated
|
||||
String getIndexType();
|
||||
String indexType();
|
||||
|
||||
/**
|
||||
* Return the doc store index name for this bean type.
|
||||
*/
|
||||
default String indexName() {
|
||||
return getIndexName();
|
||||
}
|
||||
|
||||
/**
|
||||
* Deprecated migrate to indexName().
|
||||
*/
|
||||
@Deprecated
|
||||
String getIndexName();
|
||||
String indexName();
|
||||
|
||||
/**
|
||||
* Apply the appropriate fetch path to the query such that the query returns beans matching
|
||||
@@ -62,15 +46,7 @@ public interface BeanDocType<T> {
|
||||
* For embedded 'many' properties we need a FetchPath relative to the root which is used to
|
||||
* build and replace the embedded list.
|
||||
*/
|
||||
default FetchPath embeddedManyRoot(String path) {
|
||||
return getEmbeddedManyRoot(path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deprecated migrate to embeddedManyRoot().
|
||||
*/
|
||||
@Deprecated
|
||||
FetchPath getEmbeddedManyRoot(String path);
|
||||
FetchPath embeddedManyRoot(String path);
|
||||
|
||||
/**
|
||||
* Return a 'raw' property mapped for the given property.
|
||||
|
||||
@@ -39,14 +39,6 @@ public interface ExpressionPath {
|
||||
*/
|
||||
StringParser stringParser();
|
||||
|
||||
/**
|
||||
* Deprecated migrate to stringParser().
|
||||
*/
|
||||
@Deprecated
|
||||
default StringParser getStringParser() {
|
||||
return stringParser();
|
||||
}
|
||||
|
||||
/**
|
||||
* For DateTime capable scalar types convert the long systemTimeMillis into
|
||||
* an appropriate java time (Date,Timestamp,Time,Calendar, JODA type etc).
|
||||
@@ -64,14 +56,6 @@ public interface ExpressionPath {
|
||||
*/
|
||||
int jdbcType();
|
||||
|
||||
/**
|
||||
* Deprecated migrate to jdbcType().
|
||||
*/
|
||||
@Deprecated
|
||||
default int getJdbcType() {
|
||||
return jdbcType();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if this is an ManyToOne or OneToOne associated bean property.
|
||||
*/
|
||||
@@ -85,50 +69,19 @@ public interface ExpressionPath {
|
||||
*/
|
||||
String assocIdExpression(String propName, String bindOperator);
|
||||
|
||||
/**
|
||||
* Deprecated migrate to assocIdExpression().
|
||||
*/
|
||||
@Deprecated
|
||||
default String getAssocIdExpression(String propName, String bindOperator) {
|
||||
return assocIdExpression(propName, bindOperator);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the Id values for the given bean value.
|
||||
*/
|
||||
Object[] assocIdValues(EntityBean bean);
|
||||
|
||||
/**
|
||||
* Deprecated migrate to assocIdValues().
|
||||
*/
|
||||
@Deprecated
|
||||
default Object[] getAssocIdValues(EntityBean bean) {
|
||||
return assocIdValues(bean);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the underlying bean property.
|
||||
*/
|
||||
Property property();
|
||||
|
||||
/**
|
||||
* Deprecated migrate to property().
|
||||
*/
|
||||
@Deprecated
|
||||
default Property getProperty() {
|
||||
return property();
|
||||
}
|
||||
|
||||
/**
|
||||
* The ElPrefix plus name.
|
||||
*/
|
||||
String elName();
|
||||
|
||||
/**
|
||||
* Deprecated migrate to elName().
|
||||
*/
|
||||
@Deprecated
|
||||
default String getElName() {
|
||||
return elName();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,40 +10,16 @@ public interface Property {
|
||||
*/
|
||||
String name();
|
||||
|
||||
/**
|
||||
* Deprecated migrate to name().
|
||||
*/
|
||||
@Deprecated
|
||||
default String getName() {
|
||||
return name();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the type of the property.
|
||||
*/
|
||||
Class<?> type();
|
||||
|
||||
/**
|
||||
* Deprecated migrate to type().
|
||||
*/
|
||||
@Deprecated
|
||||
default Class<?> getPropertyType() {
|
||||
return type();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the value of the property on the given bean.
|
||||
*/
|
||||
Object value(Object bean);
|
||||
|
||||
/**
|
||||
* Deprecated migrate to value().
|
||||
*/
|
||||
@Deprecated
|
||||
default Object getVal(Object bean) {
|
||||
return value(bean);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if this is a OneToMany or ManyToMany property.
|
||||
*/
|
||||
|
||||
@@ -54,14 +54,13 @@ public interface DocStoreBeanAdapter<T> extends BeanDocType<T> {
|
||||
/**
|
||||
* Return the index type for this bean type.
|
||||
*/
|
||||
@Override
|
||||
String getIndexType();
|
||||
String indexType();
|
||||
|
||||
/**
|
||||
* Return the index name for this bean type.
|
||||
*/
|
||||
@Override
|
||||
String getIndexName();
|
||||
String indexName();
|
||||
|
||||
/**
|
||||
* Process a delete by id of a given document.
|
||||
|
||||
+3
-14
@@ -102,7 +102,6 @@ public abstract class DocStoreBeanBaseAdapter<T> implements DocStoreBeanAdapter<
|
||||
private boolean registerPaths;
|
||||
|
||||
public DocStoreBeanBaseAdapter(BeanDescriptor<T> desc, DeployBeanDescriptor<T> deploy) {
|
||||
|
||||
this.desc = desc;
|
||||
this.server = desc.ebeanServer();
|
||||
this.mapped = deploy.isDocStoreMapped();
|
||||
@@ -123,7 +122,6 @@ public abstract class DocStoreBeanBaseAdapter<T> implements DocStoreBeanAdapter<
|
||||
|
||||
@Override
|
||||
public DocumentMapping createDocMapping() {
|
||||
|
||||
if (documentMapping != null) {
|
||||
return documentMapping;
|
||||
}
|
||||
@@ -143,12 +141,12 @@ public abstract class DocStoreBeanBaseAdapter<T> implements DocStoreBeanAdapter<
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getIndexType() {
|
||||
public String indexType() {
|
||||
return indexType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getIndexName() {
|
||||
public String indexName() {
|
||||
return indexName;
|
||||
}
|
||||
|
||||
@@ -159,7 +157,6 @@ public abstract class DocStoreBeanBaseAdapter<T> implements DocStoreBeanAdapter<
|
||||
|
||||
@Override
|
||||
public String rawProperty(String property) {
|
||||
|
||||
String rawProperty = sortableMap.get(property);
|
||||
return rawProperty == null ? property : rawProperty;
|
||||
}
|
||||
@@ -192,7 +189,6 @@ public abstract class DocStoreBeanBaseAdapter<T> implements DocStoreBeanAdapter<
|
||||
*/
|
||||
@Override
|
||||
public void registerInvalidationPath(String queueId, String path, Set<String> properties) {
|
||||
|
||||
if (!mapped) {
|
||||
if (update == DocStoreMode.IGNORE) {
|
||||
// bean type not mapped but is included as nested document
|
||||
@@ -207,7 +203,6 @@ public abstract class DocStoreBeanBaseAdapter<T> implements DocStoreBeanAdapter<
|
||||
* Return the DsInvalidationListener based on the properties, path.
|
||||
*/
|
||||
protected DocStoreEmbeddedInvalidation getEmbeddedInvalidation(String queueId, String path, Set<String> properties) {
|
||||
|
||||
if (properties.contains("*")) {
|
||||
return new DocStoreEmbeddedInvalidation(queueId, path);
|
||||
} else {
|
||||
@@ -245,19 +240,15 @@ public abstract class DocStoreBeanBaseAdapter<T> implements DocStoreBeanAdapter<
|
||||
* This can add derived/embedded/nested parts to the document.
|
||||
*/
|
||||
protected DocStructure derivePathProperties(PathProperties pathProps) {
|
||||
|
||||
boolean includeByDefault = (pathProps == null);
|
||||
if (pathProps == null) {
|
||||
pathProps = new PathProperties();
|
||||
}
|
||||
|
||||
return getDocStructure(pathProps, includeByDefault);
|
||||
}
|
||||
|
||||
protected DocStructure getDocStructure(PathProperties pathProps, final boolean includeByDefault) {
|
||||
|
||||
final DocStructure docStructure = new DocStructure(pathProps);
|
||||
|
||||
BeanProperty[] properties = desc.propertiesNonTransient();
|
||||
for (BeanProperty property : properties) {
|
||||
property.docStoreInclude(includeByDefault, docStructure);
|
||||
@@ -271,7 +262,6 @@ public abstract class DocStoreBeanBaseAdapter<T> implements DocStoreBeanAdapter<
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return docStructure;
|
||||
}
|
||||
|
||||
@@ -281,7 +271,7 @@ public abstract class DocStoreBeanBaseAdapter<T> implements DocStoreBeanAdapter<
|
||||
}
|
||||
|
||||
@Override
|
||||
public FetchPath getEmbeddedManyRoot(String path) {
|
||||
public FetchPath embeddedManyRoot(String path) {
|
||||
return docStructure.getEmbeddedManyRoot(path);
|
||||
}
|
||||
|
||||
@@ -297,7 +287,6 @@ public abstract class DocStoreBeanBaseAdapter<T> implements DocStoreBeanAdapter<
|
||||
|
||||
@Override
|
||||
public DocStoreMode getMode(PersistRequest.Type persistType, DocStoreMode txnMode) {
|
||||
|
||||
if (txnMode == null) {
|
||||
return getMode(persistType);
|
||||
} else if (txnMode == DocStoreMode.IGNORE) {
|
||||
|
||||
Reference in New Issue
Block a user