Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions cpo-cassandra/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,11 @@
<version>${logbackVersion}</version>
<scope>test</scope>
</dependency>
<!-- map xmlbeans log4j dependency to slf4j -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-to-slf4j</artifactId>
</dependency>
<dependency>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>
Expand All @@ -144,13 +149,11 @@
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<version>${testContainersVersion}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>cassandra</artifactId>
<version>${testContainersVersion}</version>
<artifactId>testcontainers-cassandra</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -427,30 +427,15 @@ protected <T> long processUpdateGroup(
cpoClass
.getFunctionGroup(adjustCrud(bean, crud, groupName, sess), groupName)
.getFunctions();
localLogger.info(
"=================== Class=<"
+ bean.getClass()
+ "> Type=<"
+ crud.operation
+ "> Name=<"
+ groupName
+ "> =========================");
localLogger.info(buildCpoClassLogLine(bean.getClass(), crud, groupName));

for (CpoFunction cpoFunction : cpoFunctions) {
CassandraBoundStatementFactory boundStatementFactory =
new CassandraBoundStatementFactory(
sess, this, cpoClass, cpoFunction, bean, wheres, orderBy, nativeExpressions);
executeBoundStatement(sess, boundStatementFactory);
}
localLogger.info(
"=================== "
+ " Updates - Class=<"
+ bean.getClass()
+ "> Type=<"
+ crud.operation
+ "> Name=<"
+ groupName
+ "> =========================");
localLogger.info(buildExecutedLogLine(bean.getClass(), crud, groupName));
} catch (Throwable t) {
String msg =
"ProcessUpdateGroup failed:"
Expand Down Expand Up @@ -533,14 +518,7 @@ protected <T> long processUpdateGroup(
localLogger = LoggerFactory.getLogger(cpoClass.getMetaClass());

int numStatements = 0;
localLogger.info(
"=================== Class=<"
+ beanInstance.getClass()
+ "> Type=<"
+ crud.operation
+ "> Name=<"
+ groupName
+ "> =========================");
localLogger.info(buildCpoClassLogLine(beanInstance.getClass(), crud, groupName));
ArrayList<CassandraBoundStatementFactory> statemetnFactories = new ArrayList<>();
for (T bean : beans) {
for (CpoFunction function : cpoFunctions) {
Expand All @@ -555,15 +533,7 @@ protected <T> long processUpdateGroup(
executeBatchStatements(sess, statemetnFactories);

localLogger.info(
"=================== "
+ numStatements
+ " Updates - Class=<"
+ beanInstance.getClass()
+ "> Type=<"
+ crud.operation
+ "> Name=<"
+ groupName
+ "> =========================");
buildUpdatesLogLine(numStatements, beanInstance.getClass(), crud, groupName));

} catch (Throwable t) {
String msg =
Expand Down Expand Up @@ -653,14 +623,7 @@ protected <T> T processSelectGroup(
List<CpoFunction> functions =
cpoClass.getFunctionGroup(Crud.RETRIEVE, groupName).getFunctions();

localLogger.info(
"=================== Class=<"
+ criteriaObj.getClass()
+ "> Type=<"
+ Crud.RETRIEVE.operation
+ "> Name=<"
+ groupName
+ "> =========================");
localLogger.info(buildCpoClassLogLine(criteriaObj.getClass(), Crud.RETRIEVE, groupName));

try {
rObj = (T) bean.getClass().newInstance();
Expand Down Expand Up @@ -734,26 +697,11 @@ protected <T> T processSelectGroup(
if (!recordsExist) {
rObj = null;
localLogger.info(
"=================== 0 Records - 0 Attributes - Class=<"
+ criteriaObj.getClass()
+ "> Type=<"
+ Crud.RETRIEVE.operation
+ "> Name=<"
+ groupName
+ "> =========================");
buildRecordsLogLine(0, 0, criteriaObj.getClass(), Crud.RETRIEVE, groupName));
} else {
localLogger.info(
"=================== "
+ recordCount
+ " Records - "
+ attributesSet
+ " Attributes - Class=<"
+ criteriaObj.getClass()
+ "> Type=<"
+ Crud.RETRIEVE.operation
+ "> Name=<"
+ groupName
+ "> =========================");
buildRecordsLogLine(
recordCount, attributesSet, criteriaObj.getClass(), Crud.RETRIEVE, groupName));
}
} catch (Throwable t) {
String msg = "processSelectGroup(T) failed: " + ExceptionHelper.getLocalizedMessage(t);
Expand Down Expand Up @@ -833,24 +781,10 @@ protected <T, C> Stream<T> processSelectGroup(
criteriaClass = metaDescriptor.getMetaClass(criteria);
resultClass = metaDescriptor.getMetaClass(result);
if (useRetrieve) {
localLogger.info(
"=================== Class=<"
+ criteria.getClass()
+ "> Type=<"
+ Crud.RETRIEVE.operation
+ "> Name=<"
+ groupName
+ "> =========================");
localLogger.info(buildCpoClassLogLine(criteria.getClass(), Crud.RETRIEVE, groupName));
cpoFunctions = criteriaClass.getFunctionGroup(Crud.RETRIEVE, groupName).getFunctions();
} else {
localLogger.info(
"=================== Class=<"
+ criteria.getClass()
+ "> Type=<"
+ Crud.LIST.operation
+ "> Name=<"
+ groupName
+ "> =========================");
localLogger.info(buildCpoClassLogLine(criteria.getClass(), Crud.LIST, groupName));
cpoFunctions = criteriaClass.getFunctionGroup(Crud.LIST, groupName).getFunctions();
}

Expand Down
5 changes: 5 additions & 0 deletions cpo-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</dependency>
<!-- map xmlbeans log4j dependency to slf4j -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-to-slf4j</artifactId>
</dependency>
<!-- logback implementation for test logging -->
<dependency>
<groupId>ch.qos.logback</groupId>
Expand Down
36 changes: 36 additions & 0 deletions cpo-core/src/main/java/org/synchronoss/cpo/CpoBaseAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -595,4 +595,40 @@ protected abstract <T, C> Stream<T> processSelectGroup(
Collection<CpoNativeFunction> nativeExpressions,
boolean useRetrieve)
throws CpoException;

private String buildClassInfo(Class<?> clazz, Crud crud, String groupName) {
return "Class=<"
+ clazz.getSimpleName()
+ "> Function=<"
+ crud.operation
+ "> Group=<"
+ groupName
+ "> ==========";
}

protected String buildCpoClassLogLine(Class<?> clazz, Crud crud, String groupName) {
return "========== " + buildClassInfo(clazz, crud, groupName);
}

protected String buildExecutedLogLine(Class<?> clazz, Crud crud, String groupName) {
return "========== Executed - " + buildClassInfo(clazz, crud, groupName);
}

protected String buildBatchLogLine(Class<?> clazz, Crud crud, String groupName) {
return "========== BATCH - " + buildClassInfo(clazz, crud, groupName);
}

protected String buildUpdatesLogLine(long updates, Class<?> clazz, Crud crud, String groupName) {
return "========== " + updates + " Updates - " + buildClassInfo(clazz, crud, groupName);
}

protected String buildRecordsLogLine(
long records, int attributes, Class<?> clazz, Crud crud, String groupName) {
return "========== "
+ records
+ " Records - "
+ attributes
+ " Attributes - "
+ buildClassInfo(clazz, crud, groupName);
}
}
26 changes: 13 additions & 13 deletions cpo-jdbc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
produces JAVABEANs
</description>
<properties>
<oracleVersion> 23.26.0.0.0</oracleVersion>
<oracleVersion>23.26.0.0.0</oracleVersion>
<mysqlVersion>9.5.0</mysqlVersion>
<mariadbVersion>3.5.6</mariadbVersion>
<h2Version>2.4.240</h2Version>
Expand Down Expand Up @@ -94,7 +94,7 @@

<!-- Oracle Test properties -->
<oracle.type>oracle</oracle.type>
<oracle.image>gvenzl/oracle-xe:21.3.0-slim-faststart</oracle.image>
<oracle.image>gvenzl/oracle-xe:slim-faststart</oracle.image>
<oracle.resources>src/test/resources/oracle</oracle.resources>
<oracle.user>cpo</oracle.user>
<oracle.pswd>cpo</oracle.pswd>
Expand Down Expand Up @@ -248,6 +248,11 @@
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<!-- map xmlbeans log4j dependency to slf4j -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-to-slf4j</artifactId>
</dependency>
<!-- logback implementation for test logging -->
<dependency>
<groupId>ch.qos.logback</groupId>
Expand All @@ -270,9 +275,9 @@
<!-- Oracle is provided because of the oracle transforms -->
<dependency>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc8</artifactId>
<artifactId>ojdbc11</artifactId>
<version>${oracleVersion}</version>
<scope>provided</scope>
<scope>test</scope>
</dependency>

<!-- database drivers for testing -->
Expand Down Expand Up @@ -333,31 +338,26 @@
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
<version>${testContainersVersion}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>mysql</artifactId>
<version>${testContainersVersion}</version>
<artifactId>testcontainers-mysql</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>mariadb</artifactId>
<version>${testContainersVersion}</version>
<artifactId>testcontainers-mariadb</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>postgresql</artifactId>
<version>${testContainersVersion}</version>
<artifactId>testcontainers-postgresql</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>oracle-xe</artifactId>
<version>${testContainersVersion}</version>
<artifactId>testcontainers-oracle-xe</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Loading
Loading