modofies sql deletes for docrepo to ensure correct constraint integrityk
git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@4026 8810af33-2d31-482b-a856-94f89814c4dfpull/2/head
parent
189c432378
commit
62b377fbe8
|
|
@ -187,6 +187,8 @@
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Export Import Libraries -->
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
<artifactId>jackson-core</artifactId>
|
<artifactId>jackson-core</artifactId>
|
||||||
|
|
@ -200,18 +202,21 @@
|
||||||
<artifactId>jackson-databind</artifactId>
|
<artifactId>jackson-databind</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||||
|
<artifactId>jackson-datatype-jdk8</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency> <!-- for xml ex-/import -->
|
||||||
<groupId>com.fasterxml.jackson.dataformat</groupId>
|
<groupId>com.fasterxml.jackson.dataformat</groupId>
|
||||||
<artifactId>jackson-dataformat-xml</artifactId>
|
<artifactId>jackson-dataformat-xml</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.fasterxml.jackson.dataformat</groupId>
|
|
||||||
<artifactId>jackson-dataformat-csv</artifactId>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency> <!-- better xml library -->
|
<dependency> <!-- better xml library -->
|
||||||
<groupId>org.codehaus.woodstox</groupId>
|
<groupId>org.codehaus.woodstox</groupId>
|
||||||
<artifactId>woodstox-core-asl</artifactId>
|
<artifactId>woodstox-core-asl</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency> <!-- for csv ex-/import -->
|
||||||
|
<groupId>com.fasterxml.jackson.dataformat</groupId>
|
||||||
|
<artifactId>jackson-dataformat-csv</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ import javax.persistence.EntityManager;
|
||||||
import javax.persistence.TypedQuery;
|
import javax.persistence.TypedQuery;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -198,4 +199,10 @@ public abstract class AbstractResourceRepository<T extends AbstractResource>
|
||||||
*/
|
*/
|
||||||
protected abstract TypedQuery<T> getFindForModifierQuery();
|
protected abstract TypedQuery<T> getFindForModifierQuery();
|
||||||
|
|
||||||
|
|
||||||
|
//Todo
|
||||||
|
@Override
|
||||||
|
public void initNewEntity(final T entity) {
|
||||||
|
entity.setUuid(UUID.randomUUID().toString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,24 +31,22 @@ import org.jboss.shrinkwrap.api.asset.EmptyAsset;
|
||||||
import org.jboss.shrinkwrap.api.spec.WebArchive;
|
import org.jboss.shrinkwrap.api.spec.WebArchive;
|
||||||
import org.jboss.shrinkwrap.resolver.api.maven.Maven;
|
import org.jboss.shrinkwrap.resolver.api.maven.Maven;
|
||||||
import org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage;
|
import org.jboss.shrinkwrap.resolver.api.maven.PomEquippedResolveStage;
|
||||||
import org.junit.After;
|
import org.junit.*;
|
||||||
import org.junit.AfterClass;
|
|
||||||
import org.junit.Before;
|
|
||||||
import org.junit.BeforeClass;
|
|
||||||
import org.junit.Test;
|
|
||||||
import org.junit.experimental.categories.Category;
|
import org.junit.experimental.categories.Category;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.libreccm.docrepo.File;
|
import org.libreccm.docrepo.File;
|
||||||
import org.libreccm.docrepo.FileMarshaller;
|
import org.libreccm.docrepo.FileMarshaller;
|
||||||
import org.libreccm.docrepo.FileRepository;
|
import org.libreccm.docrepo.FileRepository;
|
||||||
|
import org.libreccm.portation.Format;
|
||||||
import org.libreccm.portation.Marshals;
|
import org.libreccm.portation.Marshals;
|
||||||
import org.libreccm.tests.categories.IntegrationTest;
|
import org.libreccm.tests.categories.IntegrationTest;
|
||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import java.io.FileWriter;
|
import java.io.FileWriter;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.UUID;
|
import java.util.List;
|
||||||
|
|
||||||
import static org.hamcrest.CoreMatchers.*;
|
import static org.hamcrest.CoreMatchers.*;
|
||||||
import static org.junit.Assert.assertThat;
|
import static org.junit.Assert.assertThat;
|
||||||
|
|
@ -179,7 +177,6 @@ public class FilePortationTest {
|
||||||
@InSequence(20)
|
@InSequence(20)
|
||||||
public void fileShouldBeCreated() {
|
public void fileShouldBeCreated() {
|
||||||
file = new File();
|
file = new File();
|
||||||
file.setUuid(UUID.randomUUID().toString());
|
|
||||||
file.setName("testname");
|
file.setName("testname");
|
||||||
file.setDescription("this is a text description");
|
file.setDescription("this is a text description");
|
||||||
file.setPath(filePath + "test2.txt");
|
file.setPath(filePath + "test2.txt");
|
||||||
|
|
@ -194,10 +191,10 @@ public class FilePortationTest {
|
||||||
@Test
|
@Test
|
||||||
@InSequence(100)
|
@InSequence(100)
|
||||||
public void xmlShouldBeCreated() {
|
public void xmlShouldBeCreated() {
|
||||||
// fileMarshaller.prepare(Format.XML, filePath + "test1.xml");
|
fileMarshaller.prepare(Format.XML, filePath + "test1.xml");
|
||||||
// List<File> fileList = Collections.singletonList(file);
|
List<File> fileList = Collections.singletonList(file);
|
||||||
//
|
|
||||||
// fileMarshaller.exportList(fileList);
|
fileMarshaller.exportList(fileList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,13 @@
|
||||||
|
DELETE FROM ccm_docrepo.blob_objects;
|
||||||
|
|
||||||
|
DELETE FROM ccm_docrepo.files;
|
||||||
|
|
||||||
|
DELETE FROM ccm_docrepo.folders;
|
||||||
|
|
||||||
|
DELETE FROM ccm_docrepo.resources;
|
||||||
|
|
||||||
|
DELETE FROM ccm_docrepo.repositories;
|
||||||
|
|
||||||
DELETE FROM ccm_core.settings_big_decimal;
|
DELETE FROM ccm_core.settings_big_decimal;
|
||||||
|
|
||||||
DELETE FROM ccm_core.settings_boolean;
|
DELETE FROM ccm_core.settings_boolean;
|
||||||
|
|
|
||||||
30
pom.xml
30
pom.xml
|
|
@ -9,6 +9,7 @@
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<!--<ccm.version>7.0.0-SNAPSHOT</ccm.version>-->
|
<!--<ccm.version>7.0.0-SNAPSHOT</ccm.version>-->
|
||||||
|
<jackson-core-version>2.6.0</jackson-core-version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<groupId>org.libreccm</groupId>
|
<groupId>org.libreccm</groupId>
|
||||||
|
|
@ -426,38 +427,45 @@
|
||||||
<version>1.2</version>
|
<version>1.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Export Import Libraries -->
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
<artifactId>jackson-core</artifactId>
|
<artifactId>jackson-core</artifactId>
|
||||||
<version>2.7.0</version>
|
<version>${jackson-core-version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
<artifactId>jackson-annotations</artifactId>
|
<artifactId>jackson-annotations</artifactId>
|
||||||
<version>2.7.0</version>
|
<version>${jackson-core-version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
<artifactId>jackson-databind</artifactId>
|
<artifactId>jackson-databind</artifactId>
|
||||||
<version>2.7.0</version>
|
<version>${jackson-core-version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||||
|
<artifactId>jackson-datatype-jdk8</artifactId>
|
||||||
|
<version>${jackson-core-version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency> <!-- for xml ex-/import -->
|
<dependency> <!-- for xml ex-/import -->
|
||||||
<groupId>com.fasterxml.jackson.dataformat</groupId>
|
<groupId>com.fasterxml.jackson.dataformat</groupId>
|
||||||
<artifactId>jackson-dataformat-xml</artifactId>
|
<artifactId>jackson-dataformat-xml</artifactId>
|
||||||
<version>2.7.0</version>
|
<version>${jackson-core-version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency> <!-- for csv ex-/import -->
|
|
||||||
<groupId>com.fasterxml.jackson.dataformat</groupId>
|
|
||||||
<artifactId>jackson-dataformat-csv</artifactId>
|
|
||||||
<version>2.7.0</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency> <!-- better xml library -->
|
<dependency> <!-- better xml library -->
|
||||||
<groupId>org.codehaus.woodstox</groupId>
|
<groupId>org.codehaus.woodstox</groupId>
|
||||||
<artifactId>woodstox-core-asl</artifactId>
|
<artifactId>woodstox-core-asl</artifactId>
|
||||||
<version>4.4.1</version>
|
<version>4.4.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency> <!-- for csv ex-/import -->
|
||||||
|
<groupId>com.fasterxml.jackson.dataformat</groupId>
|
||||||
|
<artifactId>jackson-dataformat-csv</artifactId>
|
||||||
|
<version>${jackson-core-version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
**********************
|
**********************
|
||||||
Dependencies for tests
|
Dependencies for tests
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue