Commit b2163b83 authored by Gianluca Filippone's avatar Gianluca Filippone
Browse files

Resolved errors on persistence JPA module

parent 020569de
......@@ -216,12 +216,21 @@ public class MonitorLogic extends AbstractTransactionalLogic<AbstractBaseBean> {
long overhead = 0, executionTime = 0;
for (String currentOp : operations) {
opNumber++;
StartRequest startReq = startRequestDAO.find(cdName, currentOp, instanceName, choreographyName);
ForwardRequest forwardReq = forwardRequestDAO.find(cdName, currentOp, instanceName, choreographyName);
ForwardResponse forwardRes = forwardResponseDAO.find(cdName, currentOp, instanceName, choreographyName);
EndRequest endReq = endRequestDAO.find(cdName, currentOp, instanceName, choreographyName);
StartRequest startReq;
ForwardRequest forwardReq;
ForwardResponse forwardRes;
EndRequest endReq;
try {
startReq = startRequestDAO.find(cdName, currentOp, instanceName, choreographyName);
forwardReq = forwardRequestDAO.find(cdName, currentOp, instanceName, choreographyName);
forwardRes = forwardResponseDAO.find(cdName, currentOp, instanceName, choreographyName);
endReq = endRequestDAO.find(cdName, currentOp, instanceName, choreographyName);
} catch (Exception e) {
continue;
}
NumberCoordMessage numMessages = numberCoordMessageDAO.find(
cdName, currentOp, instanceName, choreographyName);
......@@ -229,7 +238,8 @@ public class MonitorLogic extends AbstractTransactionalLogic<AbstractBaseBean> {
overhead = overhead
+ (forwardReq.getRecordTime() - startReq.getRecordTime())
+ (endReq.getRecordTime() - forwardRes.getRecordTime());
executionTime = executionTime + (endReq.getRecordTime() + startReq.getRecordTime());
executionTime = executionTime + (endReq.getRecordTime() - startReq.getRecordTime());
++opNumber;
}
to.setExecutedOperations(opNumber);
......
......@@ -32,9 +32,9 @@ public class JPAEndRequestDAO extends AbstractDAO<EndRequest, Long> implements E
final String choreographyName) {
TypedQuery<EndRequest> query = entityManager().createQuery(
"SELECT e FROM" + JPAEndRequest.class.getSimpleName()
"SELECT e FROM " + JPAEndRequest.class.getSimpleName()
+ " e WHERE e.cdName = :cdName AND e.operationName = :operationName"
+ " AND e.instanceName = :instanceName AND e.choreographyName :choreographyName",
+ " AND e.instanceName = :instanceName AND e.choreographyName = :choreographyName",
EndRequest.class);
query.setParameter("cdName", cdName);
......
......@@ -32,9 +32,9 @@ public class JPAForwardRequestDAO extends AbstractDAO<ForwardRequest, Long> impl
final String choreographyName) {
TypedQuery<ForwardRequest> query = entityManager().createQuery(
"SELECT e FROM" + JPAForwardRequest.class.getSimpleName()
"SELECT e FROM " + JPAForwardRequest.class.getSimpleName()
+ " e WHERE e.cdName = :cdName AND e.operationName = :operationName"
+ " AND e.instanceName = :instanceName AND e.choreographyName :choreographyName",
+ " AND e.instanceName = :instanceName AND e.choreographyName = :choreographyName",
ForwardRequest.class);
query.setParameter("cdName", cdName);
......
......@@ -32,9 +32,9 @@ public class JPAForwardResponseDAO extends AbstractDAO<ForwardResponse, Long> im
final String choreographyName) {
TypedQuery<ForwardResponse> query = entityManager().createQuery(
"SELECT e FROM" + JPAForwardResponse.class.getSimpleName()
"SELECT e FROM " + JPAForwardResponse.class.getSimpleName()
+ " e WHERE e.cdName = :cdName AND e.operationName = :operationName"
+ " AND e.instanceName = :instanceName AND e.choreographyName :choreographyName",
+ " AND e.instanceName = :instanceName AND e.choreographyName = :choreographyName",
ForwardResponse.class);
query.setParameter("cdName", cdName);
......
......@@ -35,7 +35,7 @@ public class JPANumberCoordMessageDAO extends AbstractDAO<NumberCoordMessage, Lo
TypedQuery<NumberCoordMessage> query = entityManager().createQuery(
"SELECT e FROM " + JPANumberCoordMessage.class.getSimpleName()
+ " e WHERE e.cdName = :cdName AND e.operationName = :operationName"
+ " AND e.instanceName = :instanceName AND e.choreographyName :choreographyName",
+ " AND e.instanceName = :instanceName AND e.choreographyName = :choreographyName",
NumberCoordMessage.class);
query.setParameter("cdName", cdName);
......
......@@ -36,7 +36,7 @@ public class JPAStartRequestDAO extends AbstractDAO<StartRequest, Long> implemen
TypedQuery<StartRequest> query = entityManager().createQuery(
"SELECT e FROM " + JPAStartRequest.class.getSimpleName()
+ " e WHERE e.cdName = :cdName AND e.operationName = :operationName"
+ " AND e.instanceName = :instanceName AND e.choreographyName :choreographyName",
+ " AND e.instanceName = :instanceName AND e.choreographyName = :choreographyName",
StartRequest.class);
query.setParameter("cdName", cdName);
......
......@@ -16,19 +16,22 @@
package org.apache.syncope.core.persistence.jpa.entity;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import org.apache.syncope.core.persistence.api.entity.EndRequest;
@Entity
@Table(name = JPAEndRequest.TABLE)
@Table(name = JPAEndRequest.TABLE, uniqueConstraints = @UniqueConstraint(
columnNames = {"instanceName", "operationName", "cdName", "choreographyName"}))
public class JPAEndRequest extends AbstractEntity<Long> implements EndRequest {
private static final long serialVersionUID = 1047456207239820219L;
public static final String TABLE = "EndRequest";
@Id
@Id @GeneratedValue
private long recordId;
private String instanceName;
......
......@@ -16,19 +16,22 @@
package org.apache.syncope.core.persistence.jpa.entity;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import org.apache.syncope.core.persistence.api.entity.ForwardRequest;
@Entity
@Table(name = JPAForwardRequest.TABLE)
@Table(name = JPAForwardRequest.TABLE, uniqueConstraints = @UniqueConstraint(
columnNames = {"instanceName", "operationName", "cdName", "choreographyName"}))
public class JPAForwardRequest extends AbstractEntity<Long> implements ForwardRequest {
private static final long serialVersionUID = 1047456207239820219L;
public static final String TABLE = "ForwardRequest";
@Id
@Id @GeneratedValue
private long recordId;
private String instanceName;
......
......@@ -16,19 +16,22 @@
package org.apache.syncope.core.persistence.jpa.entity;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import org.apache.syncope.core.persistence.api.entity.ForwardResponse;
@Entity
@Table(name = JPAForwardResponse.TABLE)
@Table(name = JPAForwardResponse.TABLE, uniqueConstraints = @UniqueConstraint(
columnNames = {"instanceName", "operationName", "cdName", "choreographyName"}))
public class JPAForwardResponse extends AbstractEntity<Long> implements ForwardResponse {
private static final long serialVersionUID = 1047456207239820219L;
public static final String TABLE = "ForwardResponse";
@Id
@Id @GeneratedValue
private long recordId;
private String instanceName;
......
......@@ -16,19 +16,22 @@
package org.apache.syncope.core.persistence.jpa.entity;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import org.apache.syncope.core.persistence.api.entity.NumberCoordMessage;
@Entity
@Table(name = JPANumberCoordMessage.TABLE)
@Table(name = JPANumberCoordMessage.TABLE, uniqueConstraints = @UniqueConstraint(
columnNames = {"instanceName", "operationName", "cdName", "choreographyName"}))
public class JPANumberCoordMessage extends AbstractEntity<Long> implements NumberCoordMessage {
private static final long serialVersionUID = 1047456207239820219L;
public static final String TABLE = "NumberMessages";
@Id
@Id @GeneratedValue
private long recordId;
private String instanceName;
......
......@@ -16,19 +16,22 @@
package org.apache.syncope.core.persistence.jpa.entity;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
import org.apache.syncope.core.persistence.api.entity.StartRequest;
@Entity
@Table(name = JPAStartRequest.TABLE)
@Table(name = JPAStartRequest.TABLE, uniqueConstraints = @UniqueConstraint(
columnNames = {"instanceName", "operationName", "cdName", "choreographyName"}))
public class JPAStartRequest extends AbstractEntity<Long> implements StartRequest {
private static final long serialVersionUID = 1047456207239820219L;
public static final String TABLE = "StartRequest";
@Id
@Id @GeneratedValue
private long recordId;
private String instanceName;
......
......@@ -42,7 +42,7 @@ public class ConsoleInterfaceServiceImpl extends AbstractServiceImpl implements
@Override
public List<CoordinationDelegateTO> cdList(final String choreographyName, final String instanceName) {
return logic.cdList(instanceName, choreographyName);
return logic.cdList(choreographyName, instanceName);
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment