Skip to content

v1.0.3 #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 43 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
ced4585
Bump com.puppycrawl.tools:checkstyle from 10.12.7 to 10.13.0
dependabot[bot] Feb 6, 2024
a946039
Merge pull request #22 from xdev-software/master
JohannesRabauer Feb 7, 2024
632f1e3
Merge pull request #20 from xdev-software/dependabot/maven/com.puppyc…
JohannesRabauer Feb 7, 2024
1ca2f11
Minor fixes for starting storage in an unusual way
JohannesRabauer Feb 8, 2024
302d307
Basically working, but tests failing
JohannesRabauer Feb 8, 2024
c19e3da
Cleanup
JohannesRabauer Feb 9, 2024
89bc6b0
Importer Tests now running
JohannesRabauer Feb 9, 2024
2d88243
[Checkstyle] Fix suppression comments not working properly
AB-xdev Feb 9, 2024
9851561
[Checkstyle] Generated files should always be located in src/gen... f…
AB-xdev Feb 9, 2024
91285bb
[Checkstyle] Fix incorrect comment
AB-xdev Feb 9, 2024
074af81
Finished Importer
JohannesRabauer Feb 9, 2024
379bd94
Checkstyle fix
JohannesRabauer Feb 9, 2024
05774b7
Update CHANGELOG.md
JohannesRabauer Feb 9, 2024
b7b32e2
Merge pull request #23 from xdev-software/DataImporter
JohannesRabauer Feb 9, 2024
cf5ef4e
Merge pull request #24 from xdev-software/update-from-template
AB-xdev Feb 12, 2024
8b9c55f
Implemented plenty of Tests for specific Java Types
JohannesRabauer Feb 12, 2024
37c9f72
Renamed package
JohannesRabauer Feb 13, 2024
89d1414
Cleaned up tests
JohannesRabauer Feb 13, 2024
86f95f6
Added more java types for tests
JohannesRabauer Feb 13, 2024
9ea0ed3
HashMaps are now specifically copied when merged. There is no other, …
JohannesRabauer Feb 13, 2024
d8fd82a
Added more types to test for TypesTest
JohannesRabauer Feb 14, 2024
27596cd
Test for keyword "exists" created
JohannesRabauer Feb 14, 2024
d64f0d7
Cleanup
JohannesRabauer Feb 15, 2024
cd80f3a
Mini fix of cleanup
JohannesRabauer Feb 15, 2024
fe8bfb4
Implemented a definitive list that includes unsupported data types
JohannesRabauer Feb 15, 2024
d80e7af
Update LICENSE to ``2024``
AB-xdev Feb 21, 2024
8b1a861
Bump org.springframework.boot.version from 3.2.2 to 3.2.3
dependabot[bot] Feb 23, 2024
f9231cf
Bump org.springframework.boot:spring-boot-dependencies
dependabot[bot] Feb 23, 2024
5a1acfb
Bump com.puppycrawl.tools:checkstyle from 10.13.0 to 10.14.0
dependabot[bot] Feb 29, 2024
406bfa0
Bump com.puppycrawl.tools:checkstyle from 10.13.0 to 10.14.0
dependabot[bot] Feb 29, 2024
7f7f233
Merge pull request #25 from xdev-software/dependabot/maven/com.puppyc…
AB-xdev Feb 29, 2024
5f9e8ad
Introduce default license
AB-xdev Feb 29, 2024
c23dfd2
Merge pull request #26 from xdev-software/update-from-template
AB-xdev Feb 29, 2024
ff1bbdf
Update checkBuild.yml
AB-xdev Mar 1, 2024
49b63d3
Update sonar.yml
AB-xdev Mar 1, 2024
7143ea4
Merge pull request #28 from xdev-software/dependabot/maven/com.puppyc…
JohannesRabauer Mar 4, 2024
b09bc57
Merge pull request #27 from xdev-software/dependabot/maven/org.spring…
JohannesRabauer Mar 4, 2024
041a2bd
Merge pull request #26 from xdev-software/dependabot/maven/org.spring…
JohannesRabauer Mar 4, 2024
dc18354
Bump org.eclipse.store.version from 1.1.0 to 1.2.0
dependabot[bot] Mar 4, 2024
78a839a
Merge branch 'update-from-template' of https://github.com/xdev-softwa…
JohannesRabauer Mar 4, 2024
5349495
Merge pull request #25 from xdev-software/dependabot/maven/org.eclips…
JohannesRabauer Mar 4, 2024
ad43d8b
Merge pull request #24 from xdev-software/update-from-template
JohannesRabauer Mar 4, 2024
92b61d2
Adjusted CHANGELOG and README
JohannesRabauer Mar 4, 2024
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
20 changes: 9 additions & 11 deletions .config/checkstyle/checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<module name="LineLength">
<property name="max" value="120"/>
<property name="fileExtensions" value="java"/>
<!-- Ignore default + links in comments -->
<!-- Ignore default + links -->
<property name="ignorePattern" value="(^(package|import))|(^\s*(\/\/|\*) .*https?.*$)"/>
</module>
<module name="NewlineAtEndOfFile"/>
Expand All @@ -30,10 +30,6 @@
</module>

<!-- Generated code -->
<module name="SuppressionSingleFilter">
<property name="checks" value="."/>
<property name="files" value="[\\/](src)?gen[\\/].*\.java$"/>
</module>
<module name="SuppressionSingleFilter">
<property name="checks" value="."/>
<property name="files" value="[\\/]src[\\/]gen(erated)?[\\/].*\.java$"/>
Expand All @@ -43,7 +39,15 @@
<property name="checks" value="MagicNumberCheck"/>
<property name="files" value="[\\/]test[\\/].*\.java$"/>
</module>

<!-- Suppressions -->
<module name="SuppressWarningsFilter"/>
<!-- https://github.com/checkstyle/checkstyle/issues/7287 -->
<module name="SuppressWithPlainTextCommentFilter">
<property name="offCommentFormat" value="// CHECKSTYLE\:OFF ([\w\|]+)"/>
<property name="onCommentFormat" value="// CHECKSTYLE\:ON ([\w\|]+)"/>
<property name="checkFormat" value="$1"/>
</module>

<module name="TreeWalker">
<!-- Checks - sorted alphabetically -->
Expand Down Expand Up @@ -131,11 +135,5 @@
<property name="tokens"
value="ASSIGN,BAND,BAND_ASSIGN,BOR,BOR_ASSIGN,BSR,BSR_ASSIGN,BXOR,BXOR_ASSIGN,COLON,DIV,DIV_ASSIGN,EQUAL,GE,GT,LAND,LCURLY,LE,LOR,LT,MINUS,MINUS_ASSIGN,MOD,MOD_ASSIGN,NOT_EQUAL,PLUS,PLUS_ASSIGN,QUESTION,RCURLY,SL,SLIST,SL_ASSIGN,SR,SR_ASSIGN,STAR,STAR_ASSIGN,TYPE_EXTENSION_AND"/>
</module>

<!-- Filter -->
<module name="SuppressionCommentFilter">
<property name="offCommentFormat" value="\s*CHECKSTYLE:OFF\s*[^\s]{1,}"/>
<property name="onCommentFormat" value="\s*CHECKSTYLE:ON"/>
</module>
</module>
</module>
2 changes: 2 additions & 0 deletions .github/workflows/checkBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ on:
paths-ignore:
- '**.md'
- '.config/**'
- '.github/**'
- '.idea/**'
- 'assets/**'
pull_request:
branches: [ develop ]
paths-ignore:
- '**.md'
- '.config/**'
- '.github/**'
- '.idea/**'
- 'assets/**'

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ on:
paths-ignore:
- '**.md'
- '.config/**'
- '.github/**'
- '.idea/**'
- 'assets/**'
pull_request:
types: [opened, synchronize, reopened]
paths-ignore:
- '**.md'
- '.config/**'
- '.github/**'
- '.idea/**'
- 'assets/**'

Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 1.0.3

* Added the EclipseStoreDataImporter to import data from JPA repositories.
* Updated EclipseStore to version 1.2.0
* Updated Spring to version 3.2.3

# 1.0.2

* Added the EclipseStoreCustomRepository which has no methods defined at all.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2023 XDEV Software
Copyright 2024 XDEV Software

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,12 @@ With *Spring-Data-Eclipse-Store* every time an object is loaded from the datasto
## Installation
[Installation guide for the latest release](https://github.com/xdev-software/spring-data-eclipse-store/releases/latest#Installation)

### Prerequisites
### Supported versions

| | Minimal Version |
|--------------|-----------------|
| Java | ``17`` |
| Spring Data | ``3.2.2`` |
| EclipseStore | ``1.1.0`` |
| Spring-Data-Eclipse-Store | Java | Spring Data | EclipseStore |
|---------------------------|--------|-------------|--------------|
| ``<= 1.0.2`` | ``17`` | ``3.2.2`` | ``1.1.0`` |
| ``1.0.3`` | ``17`` | ``3.2.3`` | ``1.2.0`` |

### Usage

Expand Down
4 changes: 2 additions & 2 deletions spring-data-eclipse-store-benchmark/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<org.springframework.boot.version>3.2.2</org.springframework.boot.version>
<org.springframework.boot.version>3.2.3</org.springframework.boot.version>
<jmh.version>1.37</jmh.version>
</properties>

Expand Down Expand Up @@ -96,7 +96,7 @@
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>10.13.0</version>
<version>10.14.0</version>
</dependency>
</dependencies>
<configuration>
Expand Down
4 changes: 2 additions & 2 deletions spring-data-eclipse-store-demo/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

<mainClass>software.xdev.spring.data.eclipse.store.demo.complex.ComplexDemoApplication</mainClass>

<org.springframework.boot.version>3.2.2</org.springframework.boot.version>
<org.springframework.boot.version>3.2.3</org.springframework.boot.version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -103,7 +103,7 @@
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>10.13.0</version>
<version>10.14.0</version>
</dependency>
</dependencies>
<configuration>
Expand Down
4 changes: 2 additions & 2 deletions spring-data-eclipse-store-jpa/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

<mainClass>software.xdev.spring.data.eclipse.store.demo.complex.ComplexDemoApplication</mainClass>

<org.springframework.boot.version>3.2.2</org.springframework.boot.version>
<org.springframework.boot.version>3.2.3</org.springframework.boot.version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -123,7 +123,7 @@
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>10.12.7</version>
<version>10.14.0</version>
</dependency>
</dependencies>
<configuration>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package software.xdev.spring.data.eclipse.store.jpa;
package software.xdev.spring.data.eclipse.store.jpa.integration;

import static org.springframework.test.annotation.DirtiesContext.ClassMode.BEFORE_EACH_TEST_METHOD;

Expand All @@ -28,16 +28,13 @@
import org.springframework.test.context.TestPropertySource;
import org.springframework.test.context.junit.jupiter.SpringExtension;

import software.xdev.spring.data.eclipse.store.repository.config.EnableEclipseStoreRepositories;


@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@ExtendWith(SpringExtension.class)
@ContextConfiguration(classes = {TestConfiguration.class})
@DirtiesContext(classMode = BEFORE_EACH_TEST_METHOD)
@TestPropertySource("/application.properties")
@EnableEclipseStoreRepositories
public @interface DefaultTestAnnotations
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,70 @@
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;

import software.xdev.spring.data.eclipse.store.jpa.DefaultTestAnnotations;
import software.xdev.spring.data.eclipse.store.jpa.integration.repository.PersonToTest;
import software.xdev.spring.data.eclipse.store.jpa.integration.repository.PersonToTestRepository;
import software.xdev.spring.data.eclipse.store.importer.EclipseStoreDataImporterComponent;
import software.xdev.spring.data.eclipse.store.jpa.integration.repository.PersonToTestInEclipseStore;
import software.xdev.spring.data.eclipse.store.jpa.integration.repository.PersonToTestInEclipseStoreRepository;
import software.xdev.spring.data.eclipse.store.jpa.integration.repository.PersonToTestInJpa;
import software.xdev.spring.data.eclipse.store.jpa.integration.repository.PersonToTestInJpaRepository;
import software.xdev.spring.data.eclipse.store.repository.EclipseStoreStorage;
import software.xdev.spring.data.eclipse.store.repository.support.SimpleEclipseStoreRepository;


@DefaultTestAnnotations
public class IntegrationTest
class IntegrationTest
{
@Autowired
private PersonToTestRepository personToTestRepository;
private PersonToTestInEclipseStoreRepository personToTestInEclipseStoreRepository;

@Autowired
private PersonToTestInJpaRepository personToTestInJpaRepository;

@Autowired
private EclipseStoreDataImporterComponent eclipseStoreDataImporter;

@Autowired
private EclipseStoreStorage eclipseStoreStorage;

/**
* Super simple test if there are any start-up errors when running parallel to a JPA configuration
*/
@Test
void testBasicSaveAndFindSingleRecords()
{
final PersonToTest customer = new PersonToTest("", "");
this.personToTestRepository.save(customer);
final PersonToTestInEclipseStore customer = new PersonToTestInEclipseStore("", "");
this.personToTestInEclipseStoreRepository.save(customer);

final List<PersonToTest> customers = this.personToTestRepository.findAll();
final List<PersonToTestInEclipseStore> customers = this.personToTestInEclipseStoreRepository.findAll();
Assertions.assertEquals(1, customers.size());
Assertions.assertEquals(customer, customers.get(0));
}

@Test
void testEclipseStoreImport()
{
final PersonToTestInJpa customer = new PersonToTestInJpa("1", "", "");
this.personToTestInJpaRepository.save(customer);

final List<SimpleEclipseStoreRepository<?, ?>> simpleEclipseStoreRepositories =
this.eclipseStoreDataImporter.importData();
Assertions.assertEquals(1, simpleEclipseStoreRepositories.size());
final List<?> allEntities = simpleEclipseStoreRepositories.get(0).findAll();
Assertions.assertEquals(1, allEntities.size());

this.eclipseStoreStorage.stop();
Assertions.assertEquals(
1,
this.eclipseStoreStorage.getEntityCount(PersonToTestInJpa.class),
"After restart the imported entities are not there anymore.");
}

@Test
void testEclipseStoreEmptyImport()
{
final List<SimpleEclipseStoreRepository<?, ?>> simpleEclipseStoreRepositories =
this.eclipseStoreDataImporter.importData();
Assertions.assertEquals(1, simpleEclipseStoreRepositories.size());
final List<?> allEntities = simpleEclipseStoreRepositories.get(0).findAll();
Assertions.assertEquals(0, allEntities.size());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package software.xdev.spring.data.eclipse.store.jpa;
package software.xdev.spring.data.eclipse.store.jpa.integration;

import java.nio.file.Path;

import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.context.event.EventListener;
Expand All @@ -28,8 +31,12 @@
import software.xdev.spring.data.eclipse.store.repository.EclipseStoreStorage;
import software.xdev.spring.data.eclipse.store.repository.config.EnableEclipseStoreRepositories;


@Configuration
@ComponentScan("software.xdev.spring.data.eclipse.store.importer")
@EnableEclipseStoreRepositories
@SpringBootConfiguration
@EnableAutoConfiguration
public class TestConfiguration implements DisposableBean
{
@Autowired
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
import org.springframework.data.annotation.Id;


public class PersonToTest
public class PersonToTestInEclipseStore
{
@Id
private String id;

private final String firstName;
private final String lastName;

public PersonToTest(final String firstName, final String lastName)
public PersonToTestInEclipseStore(final String firstName, final String lastName)
{
this.firstName = firstName;
this.lastName = lastName;
Expand All @@ -30,7 +30,7 @@ public boolean equals(final Object o)
{
return false;
}
final PersonToTest customer = (PersonToTest)o;
final PersonToTestInEclipseStore customer = (PersonToTestInEclipseStore)o;
return Objects.equals(this.id, customer.id) && Objects.equals(this.firstName, customer.firstName)
&& Objects.equals(this.lastName, customer.lastName);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
import software.xdev.spring.data.eclipse.store.repository.interfaces.EclipseStoreListCrudRepository;


public interface PersonToTestRepository extends EclipseStoreListCrudRepository<PersonToTest, String>
public interface PersonToTestInEclipseStoreRepository extends EclipseStoreListCrudRepository<PersonToTestInEclipseStore, String>
{
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package software.xdev.spring.data.eclipse.store.jpa.integration.repository;

import java.util.Objects;

import jakarta.persistence.Entity;
import jakarta.persistence.Id;


@Entity
public class PersonToTestInJpa
{
@Id
private String id;

private String firstName;
private String lastName;

public PersonToTestInJpa(final String id, final String firstName, final String lastName)
{
this.id = id;
this.firstName = firstName;
this.lastName = lastName;
}

public PersonToTestInJpa()
{

}

@Override
public boolean equals(final Object o)
{
if(this == o)
{
return true;
}
if(o == null || this.getClass() != o.getClass())
{
return false;
}
final PersonToTestInJpa customer = (PersonToTestInJpa)o;
return Objects.equals(this.id, customer.id) && Objects.equals(this.firstName, customer.firstName)
&& Objects.equals(this.lastName, customer.lastName);
}

@Override
public int hashCode()
{
return Objects.hash(this.id, this.firstName, this.lastName);
}
}
Loading