You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@batchee.apache.org by st...@apache.org on 2014/04/19 10:51:35 UTC
git commit: BATCHEE-26 rename table names
Repository: incubator-batchee
Updated Branches:
refs/heads/master dd62c2361 -> 7b4fe1401
BATCHEE-26 rename table names
Project: http://git-wip-us.apache.org/repos/asf/incubator-batchee/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-batchee/commit/7b4fe140
Tree: http://git-wip-us.apache.org/repos/asf/incubator-batchee/tree/7b4fe140
Diff: http://git-wip-us.apache.org/repos/asf/incubator-batchee/diff/7b4fe140
Branch: refs/heads/master
Commit: 7b4fe140124e7f68d2a6b157f3e8a3e09883b851
Parents: dd62c23
Author: Mark Struberg <st...@apache.org>
Authored: Sat Apr 19 10:49:32 2014 +0200
Committer: Mark Struberg <st...@apache.org>
Committed: Sat Apr 19 10:49:32 2014 +0200
----------------------------------------------------------------------
.../persistence/JDBCPersistenceManagerService.java | 12 ++++++++----
.../persistence/jpa/domain/CheckpointEntity.java | 4 ++++
.../persistence/jpa/domain/JobExecutionEntity.java | 4 ++++
.../persistence/jpa/domain/JobInstanceEntity.java | 5 +++++
.../persistence/jpa/domain/StepExecutionEntity.java | 5 +++++
5 files changed, 26 insertions(+), 4 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/7b4fe140/jbatch/src/main/java/org/apache/batchee/container/services/persistence/JDBCPersistenceManagerService.java
----------------------------------------------------------------------
diff --git a/jbatch/src/main/java/org/apache/batchee/container/services/persistence/JDBCPersistenceManagerService.java b/jbatch/src/main/java/org/apache/batchee/container/services/persistence/JDBCPersistenceManagerService.java
index 65aa927..30195e8 100755
--- a/jbatch/src/main/java/org/apache/batchee/container/services/persistence/JDBCPersistenceManagerService.java
+++ b/jbatch/src/main/java/org/apache/batchee/container/services/persistence/JDBCPersistenceManagerService.java
@@ -32,6 +32,10 @@ import org.apache.batchee.container.services.InternalJobExecution;
import org.apache.batchee.container.services.persistence.jdbc.Dictionary;
import org.apache.batchee.container.services.persistence.jdbc.database.Database;
import org.apache.batchee.container.services.persistence.jdbc.database.DerbyDatabase;
+import org.apache.batchee.container.services.persistence.jpa.domain.CheckpointEntity;
+import org.apache.batchee.container.services.persistence.jpa.domain.JobExecutionEntity;
+import org.apache.batchee.container.services.persistence.jpa.domain.JobInstanceEntity;
+import org.apache.batchee.container.services.persistence.jpa.domain.StepExecutionEntity;
import org.apache.batchee.container.status.JobStatus;
import org.apache.batchee.container.status.StepStatus;
import org.apache.batchee.container.util.TCCLObjectInputStream;
@@ -146,10 +150,10 @@ public class JDBCPersistenceManagerService implements PersistenceManagerService
try {
final Database database = Database.class.cast(Thread.currentThread().getContextClassLoader().loadClass(type).newInstance());
dictionary = new Dictionary(
- batchConfig.getProperty("persistence.database.tables.checkpoint", "checkpointentity"),
- batchConfig.getProperty("persistence.database.tables.job-instance", "jobinstanceentity"),
- batchConfig.getProperty("persistence.database.tables.job-execution", "jobexecutionentity"),
- batchConfig.getProperty("persistence.database.tables.step-execution", "stepexecutionentity"),
+ batchConfig.getProperty("persistence.database.tables.checkpoint", CheckpointEntity.TABLE_NAME),
+ batchConfig.getProperty("persistence.database.tables.job-instance", JobInstanceEntity.TABLE_NAME),
+ batchConfig.getProperty("persistence.database.tables.job-execution", JobExecutionEntity.TABLE_NAME),
+ batchConfig.getProperty("persistence.database.tables.step-execution", StepExecutionEntity.TABLE_NAME),
database);
} catch (final Exception e) {
throw new BatchContainerServiceException(e);
http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/7b4fe140/jbatch/src/main/java/org/apache/batchee/container/services/persistence/jpa/domain/CheckpointEntity.java
----------------------------------------------------------------------
diff --git a/jbatch/src/main/java/org/apache/batchee/container/services/persistence/jpa/domain/CheckpointEntity.java b/jbatch/src/main/java/org/apache/batchee/container/services/persistence/jpa/domain/CheckpointEntity.java
index 9594e73..ccac415 100644
--- a/jbatch/src/main/java/org/apache/batchee/container/services/persistence/jpa/domain/CheckpointEntity.java
+++ b/jbatch/src/main/java/org/apache/batchee/container/services/persistence/jpa/domain/CheckpointEntity.java
@@ -27,6 +27,7 @@ import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
+import javax.persistence.Table;
@Entity
@NamedQueries({
@@ -34,12 +35,15 @@ import javax.persistence.NamedQuery;
query = "select c from CheckpointEntity c where c.instance.jobInstanceId = :jobInstanceId and c.stepName = :stepName and c.type = :type"),
@NamedQuery(name = CheckpointEntity.Queries.DELETE_BY_INSTANCE_ID, query = "delete from CheckpointEntity e where e.instance.jobInstanceId = :id")
})
+@Table(name=CheckpointEntity.TABLE_NAME)
public class CheckpointEntity {
public static interface Queries {
String FIND = "org.apache.batchee.container.services.persistence.jpa.domain.CheckpointEntity.find";
String DELETE_BY_INSTANCE_ID = "org.apache.batchee.container.services.persistence.jpa.domain.CheckpointEntity.deleteByInstanceId";
}
+ public static final String TABLE_NAME = "BATCH_CHECKPOINT";
+
@Id
@GeneratedValue
private String id;
http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/7b4fe140/jbatch/src/main/java/org/apache/batchee/container/services/persistence/jpa/domain/JobExecutionEntity.java
----------------------------------------------------------------------
diff --git a/jbatch/src/main/java/org/apache/batchee/container/services/persistence/jpa/domain/JobExecutionEntity.java b/jbatch/src/main/java/org/apache/batchee/container/services/persistence/jpa/domain/JobExecutionEntity.java
index d660dad..7ef8c1d 100644
--- a/jbatch/src/main/java/org/apache/batchee/container/services/persistence/jpa/domain/JobExecutionEntity.java
+++ b/jbatch/src/main/java/org/apache/batchee/container/services/persistence/jpa/domain/JobExecutionEntity.java
@@ -26,6 +26,7 @@ import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
+import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import java.sql.Timestamp;
@@ -41,6 +42,7 @@ import java.util.Properties;
@NamedQuery(name = JobExecutionEntity.Queries.DELETE_BY_INSTANCE_ID, query = "delete from JobExecutionEntity e where e.instance.jobInstanceId = :instanceId"),
@NamedQuery(name = JobExecutionEntity.Queries.FIND_RUNNING, query = "SELECT e FROM JobExecutionEntity e WHERE e.batchStatus in :statuses and e.instance.name = :name")
})
+@Table(name=JobExecutionEntity.TABLE_NAME)
public class JobExecutionEntity {
public static interface Queries {
String MOST_RECENT = "org.apache.batchee.container.services.persistence.jpa.domain.JobExecutionEntity.mostRecent";
@@ -51,6 +53,8 @@ public class JobExecutionEntity {
List<BatchStatus> RUNNING_STATUSES = Arrays.asList(BatchStatus.STARTED, BatchStatus.STARTING, BatchStatus.STOPPING);
}
+ public static final String TABLE_NAME = "BATCH_JOBEXECUTION";
+
@Id
@GeneratedValue
private long executionId;
http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/7b4fe140/jbatch/src/main/java/org/apache/batchee/container/services/persistence/jpa/domain/JobInstanceEntity.java
----------------------------------------------------------------------
diff --git a/jbatch/src/main/java/org/apache/batchee/container/services/persistence/jpa/domain/JobInstanceEntity.java b/jbatch/src/main/java/org/apache/batchee/container/services/persistence/jpa/domain/JobInstanceEntity.java
index b4bd80a..94ebe81 100644
--- a/jbatch/src/main/java/org/apache/batchee/container/services/persistence/jpa/domain/JobInstanceEntity.java
+++ b/jbatch/src/main/java/org/apache/batchee/container/services/persistence/jpa/domain/JobInstanceEntity.java
@@ -29,6 +29,8 @@ import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
+import javax.persistence.Table;
+
import java.util.List;
@Entity
@@ -41,6 +43,7 @@ import java.util.List;
@NamedQuery(name = JobInstanceEntity.Queries.FIND_BY_NAME, query = "select j from JobInstanceEntity j where j.name = :name"),
@NamedQuery(name = JobInstanceEntity.Queries.DELETE_BY_INSTANCE_ID, query = "delete from JobInstanceEntity e where e.jobInstanceId = :instanceId")
})
+@Table(name=JobInstanceEntity.TABLE_NAME)
public class JobInstanceEntity {
public static interface Queries {
String COUNT_BY_NAME_AND_TAG = "org.apache.batchee.container.services.persistence.jpa.domain.JobInstanceEntity.countByNameAndTag";
@@ -52,6 +55,8 @@ public class JobInstanceEntity {
String DELETE_BY_INSTANCE_ID = "org.apache.batchee.container.services.persistence.jpa.domain.JobInstanceEntity.deleteFromInstanceId";
}
+ public static final String TABLE_NAME = "BATCH_JOBINSTANCE";
+
@Id
@GeneratedValue
private long jobInstanceId;
http://git-wip-us.apache.org/repos/asf/incubator-batchee/blob/7b4fe140/jbatch/src/main/java/org/apache/batchee/container/services/persistence/jpa/domain/StepExecutionEntity.java
----------------------------------------------------------------------
diff --git a/jbatch/src/main/java/org/apache/batchee/container/services/persistence/jpa/domain/StepExecutionEntity.java b/jbatch/src/main/java/org/apache/batchee/container/services/persistence/jpa/domain/StepExecutionEntity.java
index e72483b..0c85674 100644
--- a/jbatch/src/main/java/org/apache/batchee/container/services/persistence/jpa/domain/StepExecutionEntity.java
+++ b/jbatch/src/main/java/org/apache/batchee/container/services/persistence/jpa/domain/StepExecutionEntity.java
@@ -27,6 +27,7 @@ import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
+import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import java.sql.Timestamp;
@@ -38,6 +39,7 @@ import java.sql.Timestamp;
@NamedQuery(name = StepExecutionEntity.Queries.FIND_BY_INSTANCE_AND_NAME,
query = "select se FROM StepExecutionEntity se where se.execution.instance.jobInstanceId = :instanceId and se.stepName = :step")
})
+@Table(name=StepExecutionEntity.TABLE_NAME)
public class StepExecutionEntity {
public static interface Queries {
String FIND_BY_EXECUTION = "org.apache.batchee.container.services.persistence.jpa.domain.StepExecutionEntity.findByExecution";
@@ -45,6 +47,9 @@ public class StepExecutionEntity {
String DELETE_BY_INSTANCE_ID = "org.apache.batchee.container.services.persistence.jpa.domain.StepExecutionEntity.deleteByInstanceId";
}
+ public static final String TABLE_NAME = "BATCH_STEPEXECUTION";
+
+
@Id
@GeneratedValue
private long id;