mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-12 22:41:35 +00:00
#2342 - Rename Database.getName() to Database.name() with deprecation
This commit is contained in:
1 parent
6311d0bf4e
commit
f770b66f42
15 files changed
+24
-16
No files matched your search
@@ -56,7 +56,7 @@ public class ClusterManager implements ServerLookup {
|
||||
public void registerServer(EbeanServer server) {
|
||||
lock.lock();
|
||||
try {
|
||||
serverMap.put(server.getName(), server);
|
||||
serverMap.put(server.name(), server);
|
||||
if (!started) {
|
||||
startup();
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ final class DefaultQueryPlanListener implements QueryPlanListener {
|
||||
@Override
|
||||
public void process(QueryPlanCapture capture) {
|
||||
// better to log this in JSON form?
|
||||
String dbName = capture.getDatabase().getName();
|
||||
String dbName = capture.getDatabase().name();
|
||||
for (MetaQueryPlan plan : capture.getPlans()) {
|
||||
log.info("queryPlan db:{} label:{} queryTimeMicros:{} loc:{} sql:{} bind:{} plan:{}",
|
||||
dbName, plan.label(), plan.queryTimeMicros(), plan.profileLocation(),
|
||||
|
||||
@@ -499,7 +499,7 @@ public final class DefaultServer implements SpiServer, SpiEbeanServer {
|
||||
* Return the server name.
|
||||
*/
|
||||
@Override
|
||||
public String getName() {
|
||||
public String name() {
|
||||
return serverName;
|
||||
}
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ final class DumpMetrics {
|
||||
|
||||
void dump() {
|
||||
|
||||
out("-- Dumping metrics for " + server.getName() + " -- ");
|
||||
out("-- Dumping metrics for " + server.name() + " -- ");
|
||||
ServerMetrics serverMetrics = server.getMetaInfoManager().collectMetrics();
|
||||
|
||||
for (MetaTimedMetric metric : serverMetrics.timedMetrics()) {
|
||||
|
||||
@@ -112,7 +112,7 @@ final class DumpMetricsJson implements ServerMetricsAsJson {
|
||||
if (withHeader) {
|
||||
objStart();
|
||||
key("db");
|
||||
val(database.getName());
|
||||
val(database.name());
|
||||
key("metrics");
|
||||
listStart();
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ abstract class DLoadBaseContext {
|
||||
|
||||
DLoadBaseContext(DLoadContext parent, BeanDescriptor<?> desc, String path, OrmQueryProperties queryProps) {
|
||||
this.parent = parent;
|
||||
this.serverName = parent.getEbeanServer().getName();
|
||||
this.serverName = parent.getEbeanServer().name();
|
||||
this.desc = desc;
|
||||
this.queryProps = queryProps;
|
||||
this.fullPath = parent.getFullPath(path);
|
||||
|
||||
@@ -74,7 +74,7 @@ final class DLoadManyContext extends DLoadBaseContext implements LoadManyContext
|
||||
|
||||
|
||||
public String getName() {
|
||||
return parent.getEbeanServer().getName();
|
||||
return parent.getEbeanServer().name();
|
||||
}
|
||||
|
||||
public void register(BeanCollection<?> bc) {
|
||||
|
||||
@@ -348,7 +348,7 @@ public class TDSpiEbeanServer implements SpiEbeanServer {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
public String name() {
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
@@ -194,7 +194,7 @@ public class TestQueryFindIterate extends BaseTestCase {
|
||||
|
||||
});
|
||||
|
||||
if (!DB.getDefault().getName().equals("h2")) {
|
||||
if (!DB.getDefault().name().equals("h2")) {
|
||||
// MySql allows the query with type conversion?
|
||||
throw new PersistenceException("H2 does expected thing but MySql does not");
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ public class TestCustomerFinder extends BaseTestCase {
|
||||
assertThat(customer.getId()).isEqualTo(customer1.getId());
|
||||
assertThat(customer.getName()).isEqualTo(customer1.getName());
|
||||
|
||||
assertThat(Customer.find.db().getName()).isEqualTo(DB.getDefault().getName());
|
||||
assertThat(Customer.find.db().name()).isEqualTo(DB.getDefault().name());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in new issue
Block a user