Skip to content

Commit

Permalink
bump to the new sofia. limit repeats on certain messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
evanchooly committed May 16, 2023
1 parent f428b8f commit 4408c64
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
4 changes: 2 additions & 2 deletions core/src/main/java/dev/morphia/DatastoreImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public <T> void insert(List<T> entities, InsertManyOptions options) {

String alternate = options.collection();
if (alternate != null && grouped.size() > 1) {
LOG.warn(Sofia.insertManyAlternateCollection(alternate));
Sofia.logInsertManyAlternateCollection(alternate);
}

grouped.entrySet().stream()
Expand Down Expand Up @@ -571,7 +571,7 @@ public <T> List<T> save(List<T> entities, InsertManyOptions options) {

String alternate = options.collection();
if (grouped.size() > 1 && alternate != null) {
LOG.warn(Sofia.insertManyAlternateCollection(alternate));
Sofia.logInsertManyAlternateCollection(alternate);
}

for (Entry<Class<?>, List<T>> entry : grouped.entrySet()) {
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/dev/morphia/query/LegacyQueryFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import dev.morphia.Datastore;

import dev.morphia.sofia.Sofia;
import org.bson.Document;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -21,8 +22,7 @@ public class LegacyQueryFactory implements QueryFactory {
* Logs a message stating this (obscured/hidden) class is going away and to read the website for steps on how to migrate away from it.
*/
public LegacyQueryFactory() {
LOG.info("The legacy query API is being removed. Please update your configuration to the modern options (via MapperOptions"
+ ".builder()) or by using only the legacy mapping option using MapperOptions.legacyMapping()");
Sofia.logLegacyQuery();
}

@Override
Expand Down
6 changes: 4 additions & 2 deletions core/src/main/resources/sofia.properties
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ invalid.index.path=The path ''{0}'' can not be validated against ''{1}'' and may
invalid.path.target=Could not resolve path ''{0}'' against ''{1}''. Unknown path element: ''{2}''.
key.not.allowed.as.property=Keys are not allowed as properties. Use (lazy) references instead.
legacy.operation=This is a legacy operation and is not supported on this version of the API.
@info[once].legacy.query=The legacy query API is being removed. Please update your configuration to the modern options (via \
MapperOptions.builder()) or by using only the legacy mapping options on MapperOptions. See the javadoc for MapperOptions#legacy() for more.
lifecycle.noargs=A type with lifecycle events must have a no-arg constructor: {0}
logged.query=logged query: {0}
mismatched.field.on.external.type=Mapped field ''{0}'' on ''{1}'' does not match any fields on ''{2}''.
Expand Down Expand Up @@ -83,8 +85,8 @@ test.feature.only=This feature is intended for testing and debugging only.
no.mapped.classes=No classes have been mapped.
ignoring.transient.property={0} is marked as transient and will not be persisted.
unset.names.dollar.sign=Field names in a $unset can not start with ''$''. Automatically stripping the ''$'' from the names.
insert.many.alternate.collection=You have specified an alternate collection (''{0}'') when inserting many entities of different types. \
This will put all entities, regardless of type, in to the same collection.
@warn[once].insert.many.alternate.collection=You have specified an alternate collection (''{0}'') when inserting many entities of \
different types. This will put all entities, regardless of type, in to the same collection.
calling.lifecycle.method=Calling lifecycle method(@{0} {1}) on {2}
calling.interceptor.method=Calling interceptor method {0} on {1}
### Document Reader
Expand Down
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<revapi.java.version>0.28.1</revapi.java.version>
<roaster.version>2.28.0.Final</roaster.version>
<slf4j.version>2.0.7</slf4j.version>
<sofia.version>0.23</sofia.version>
<sofia.version>0.25</sofia.version>
<surefire.version>3.1.0</surefire.version>
<testng.version>7.7.1</testng.version>
<zt.exec.version>1.12</zt.exec.version>
Expand Down Expand Up @@ -221,7 +221,7 @@
</executions>
<configuration>
<spotbugsXmlOutputDirectory>target/spotbugs</spotbugsXmlOutputDirectory>
<excludeFilterFile>../config/findbugs-exclude.xml</excludeFilterFile>
<excludeFilterFile>${maven.multiModuleProjectDirectory}/config/findbugs-exclude.xml</excludeFilterFile>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -275,12 +275,12 @@
<configuration>
<java>
<eclipse>
<file>${basedir}/../config/eclipse-format.xml</file>
<file>maven.multiModuleProjectDirectory/config/eclipse-format.xml</file>
</eclipse>
<!--<googleJavaFormat />-->

<importOrder>
<file>${basedir}/../config/eclipse.importorder</file>
<file>${maven.multiModuleProjectDirectory}/config/eclipse.importorder</file>
</importOrder>

<removeUnusedImports />
Expand Down Expand Up @@ -410,7 +410,7 @@
</goals>
<phase>generate-sources</phase>
<configuration>
<sourceFile>${session.executionRootDirectory}/LICENSE</sourceFile>
<sourceFile>${maven.multiModuleProjectDirectory}/LICENSE</sourceFile>
<destinationFile>${project.build.outputDirectory}/META-INF/LICENSE-${project.artifactId}</destinationFile>
</configuration>
</execution>
Expand Down

0 comments on commit 4408c64

Please sign in to comment.