Skip to content

Commit

Permalink
Remove misc. deprecated items, disable integration tests temporarily
Browse files Browse the repository at this point in the history
  • Loading branch information
Idane committed Aug 15, 2021
1 parent 4cb55e2 commit 3c02776
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,26 +179,6 @@ <ID extends Serializable, Entity extends BaseCrudEntity<ID>> MassUpdateCRUDReque
<ID extends Serializable, Entity extends BaseCrudEntity<ID>, RO> MassUpdateCRUDRequestBuilder<CRUDPreUpdateHook<ID, Entity>, CRUDOnUpdateHook<ID, Entity>, CRUDPostUpdateHook<ID, Entity>, List<RO>> update(
List<Entity> entities, Class<RO> toClazz);

/**
* @deprecated name changed, see below for new method
* @see {@link CrudHandler#updateByFilter(DynamicModelFilter, Class)}
*/
@Deprecated
default <ID extends Serializable, Entity extends BaseCrudEntity<ID>> MassUpdateCRUDRequestBuilder<CRUDPreUpdateHook<ID, Entity>, CRUDOnUpdateHook<ID, Entity>, CRUDPostUpdateHook<ID, Entity>, List<Entity>> updateFrom(
DynamicModelFilter filter, Class<Entity> entityClazz) {
return updateByFilter(filter, entityClazz);
}

/**
* @deprecated name changed, see below for new method
* @see {@link CrudHandler#updateByFilter(DynamicModelFilter, Class, Class)}
*/
@Deprecated
default <ID extends Serializable, Entity extends BaseCrudEntity<ID>, RO> MassUpdateCRUDRequestBuilder<CRUDPreUpdateHook<ID, Entity>, CRUDOnUpdateHook<ID, Entity>, CRUDPostUpdateHook<ID, Entity>, List<RO>> updateFrom(
DynamicModelFilter filter, Class<Entity> entityClazz, Class<RO> toClazz) {
return updateByFilter(filter, entityClazz, toClazz);
}

<ID extends Serializable, Entity extends BaseCrudEntity<ID>> MassUpdateCRUDRequestBuilder<CRUDPreUpdateHook<ID, Entity>, CRUDOnUpdateHook<ID, Entity>, CRUDPostUpdateHook<ID, Entity>, List<Entity>> updateByFilter(
DynamicModelFilter filter, Class<Entity> entityClazz);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import com.antelopesystem.crudframework.modelfilter.dsl.annotation.FilterFieldDs

@FilterFieldDsl
class ModelFilterBuilder(
@Deprecated("set order within the order {} block instead") var orderBy: String = "",
@Deprecated("set order within the order {} block instead") var orderDesc: Boolean = true,
var orders: MutableSet<OrderDTO> = mutableSetOf(),
var start: Int = 0,
var limit: Int = 10000,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ public void setUp() throws Exception {
entityManager.persist(readOnlyEntity1);
entityManager.persist(readOnlyEntity2);

readOnlyEntityRO1.setId(readOnlyEntity1.getId());
readOnlyEntityRO1.setCreationTime(readOnlyEntity1.getCreationTime().getTime());

readOnlyEntityRO2.setId(readOnlyEntity2.getId());
readOnlyEntityRO2.setCreationTime(readOnlyEntity2.getCreationTime().getTime());
// readOnlyEntityRO1.setId(readOnlyEntity1.getId());
// readOnlyEntityRO1.setCreationTime(readOnlyEntity1.getCreationTime().getTime());
//
// readOnlyEntityRO2.setId(readOnlyEntity2.getId());
// readOnlyEntityRO2.setCreationTime(readOnlyEntity2.getCreationTime().getTime());
entityManager.flush();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public void testUpdateFrom() {
TestEntity expectedOutcome = new TestEntity();
expectedOutcome.setGenericVariable(1999L);

List<TestEntity> outcome = crudHandler.updateFrom(new DynamicModelFilter().add(FilterFields.inLong("id", Arrays.asList(testEntity.getId(), testEntity2.getId()))), TestEntity.class)
List<TestEntity> outcome = crudHandler.updateByFilter(new DynamicModelFilter().add(FilterFields.inLong("id", Arrays.asList(testEntity.getId(), testEntity2.getId()))), TestEntity.class)
.withOnHook((e) -> e.setGenericVariable(1999L))
.execute();
assertEquals(outcome.size(), 2);
Expand All @@ -38,7 +38,7 @@ public void testUpdateWithRO() {
expectedOutcome.setGenericVariable(1999L);


List<TestEntityRO> outcome = crudHandler.updateFrom(new DynamicModelFilter().add(FilterFields.inLong("id", Arrays.asList(testEntity.getId(), testEntity2.getId()))), TestEntity.class, TestEntityRO.class)
List<TestEntityRO> outcome = crudHandler.updateByFilter(new DynamicModelFilter().add(FilterFields.inLong("id", Arrays.asList(testEntity.getId(), testEntity2.getId()))), TestEntity.class, TestEntityRO.class)
.withOnHook((e) -> e.setGenericVariable(1999L))
.execute();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public void testUpdateFrom() {
TestEntity testEntity = persistNewTestEntity();

TestEntityRO testEntityRO = new TestEntityRO();
testEntityRO.setId(testEntity.getId());
// testEntityRO.setId(testEntity.getId());
testEntityRO.setGenericVariable(1999L);

TestEntity expectedOutcome = new TestEntity();
Expand All @@ -30,7 +30,7 @@ public void testUpdateWithRO() {
TestEntity testEntity = persistNewTestEntity();

TestEntityRO testEntityRO = new TestEntityRO();
testEntityRO.setId(testEntity.getId());
// testEntityRO.setId(testEntity.getId());
testEntityRO.setGenericVariable(1999L);

TestEntity expectedOutcome = new TestEntity();
Expand All @@ -48,7 +48,7 @@ public void testUpdateFromHooks() {
TestEntity testEntity = persistNewTestEntity();

TestEntityRO testEntityRO = new TestEntityRO();
testEntityRO.setId(testEntity.getId());
// testEntityRO.setId(testEntity.getId());
testEntityRO.setGenericVariable(1999L);

TestEntity expectedOutcome = new TestEntity();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import com.antelopesystem.crudframework.fieldmapper.transformer.CommaDelimitedSt
import com.antelopesystem.crudframework.fieldmapper.transformer.DateToLongTransformer
import com.antelopesystem.crudframework.fieldmapper.transformer.LongToCurrencyDoubleTransformer
import com.antelopesystem.crudframework.fieldmapper.transformer.ToStringTransformer
import com.antelopesystem.crudframework.jpa.model.AbstractJpaCrudEntity
import com.antelopesystem.crudframework.jpa.model.AbstractJpaUpdatableCrudEntity
import java.util.*
import javax.persistence.Entity
import javax.persistence.Table

@Entity
@Table(name = "test_entity")
class TestEntity : AbstractJpaCrudEntity {
class TestEntity : AbstractJpaUpdatableCrudEntity {
@MappedField(target = TestEntityRO::class, transformer = CommaDelimitedStringToListTransformer::class, mapTo = "stringList")
var commaDelimitedString = "val1,val2,val3,val4"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
import com.antelopesystem.crudframework.fieldmapper.transformer.CurrencyDoubleToLongTransformer;
import com.antelopesystem.crudframework.fieldmapper.transformer.LongToDateTransformer;
import com.antelopesystem.crudframework.fieldmapper.transformer.StringListToCommaDelimitedStringTransformer;
import com.antelopesystem.crudframework.ro.BaseRO;
import com.antelopesystem.crudframework.jpa.ro.AbstractJpaUpdatableCrudRO;

import java.util.Arrays;
import java.util.List;
import java.util.Objects;

public class TestEntityRO extends BaseRO {
public class TestEntityRO extends AbstractJpaUpdatableCrudRO {

@MappedField(target = TestEntity.class, transformer = StringListToCommaDelimitedStringTransformer.class, mapTo = "commaDelimitedString")
private List<String> stringList = Arrays.asList("val1", "val2", "val3", "val4");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
package com.antelopesystem.crudframework.utils.component.componentmap.annotation

import kotlin.reflect.KClass

@Target(AnnotationTarget.FIELD)
annotation class ComponentMap(@Deprecated("no longer used") val key: KClass<*> = Unit::class, @Deprecated("no longer used") val value: KClass<*> = Unit::class)
annotation class ComponentMap

0 comments on commit 3c02776

Please sign in to comment.