Removed unnecessary entitygraph usage.

Signed-off-by: Kai Zimmermann <kai.zimmermann@bosch-si.com>
This commit is contained in:
Kai Zimmermann
2016-02-17 09:57:07 +01:00
parent 3334cf4a64
commit 01b75fc932
2 changed files with 9 additions and 25 deletions

View File

@@ -37,16 +37,6 @@ import org.springframework.transaction.annotation.Transactional;
*/ */
@Transactional(readOnly = true) @Transactional(readOnly = true)
public interface ActionRepository extends BaseEntityRepository<Action, Long>, JpaSpecificationExecutor<Action> { public interface ActionRepository extends BaseEntityRepository<Action, Long>, JpaSpecificationExecutor<Action> {
/*
* (non-Javadoc)
*
* @see org.springframework.data.repository.CrudRepository#findAll()
*/
@Override
@EntityGraph(value = "Action.all", type = EntityGraphType.LOAD)
Iterable<Action> findAll();
/** /**
* Retrieves an Action with all lazy attributes. * Retrieves an Action with all lazy attributes.
* *
@@ -67,7 +57,6 @@ public interface ActionRepository extends BaseEntityRepository<Action, Long>, Jp
* the {@link DistributionSet} on which will be filtered * the {@link DistributionSet} on which will be filtered
* @return the found {@link Action}s * @return the found {@link Action}s
*/ */
@EntityGraph(value = "Action.all", type = EntityGraphType.LOAD)
Page<Action> findByDistributionSet(final Pageable pageable, final DistributionSet ds); Page<Action> findByDistributionSet(final Pageable pageable, final DistributionSet ds);
/** /**
@@ -84,7 +73,8 @@ public interface ActionRepository extends BaseEntityRepository<Action, Long>, Jp
/** /**
* Retrieves all {@link Action}s which are active and referring the given * Retrieves all {@link Action}s which are active and referring the given
* {@link Target} in a specified order. * {@link Target} in a specified order. Loads also the lazy
* {@link Action#getDistributionSet()} field.
* *
* @param pageable * @param pageable
* page parameters * page parameters
@@ -125,7 +115,6 @@ public interface ActionRepository extends BaseEntityRepository<Action, Long>, Jp
* @return the found {@link UpdateAction}s * @return the found {@link UpdateAction}s
*/ */
@Query("Select a from Action a where a.target = :target and a.distributionSet = :ds order by a.id") @Query("Select a from Action a where a.target = :target and a.distributionSet = :ds order by a.id")
@EntityGraph(value = "Action.all", type = EntityGraphType.LOAD)
Page<Action> findByTargetAndDistributionSet(final Pageable pageable, @Param("target") final Target target, Page<Action> findByTargetAndDistributionSet(final Pageable pageable, @Param("target") final Target target,
@Param("ds") DistributionSet ds); @Param("ds") DistributionSet ds);
@@ -159,7 +148,8 @@ public interface ActionRepository extends BaseEntityRepository<Action, Long>, Jp
/** /**
* Retrieves all {@link Action}s of a specific target and given active flag * Retrieves all {@link Action}s of a specific target and given active flag
* ordered by action ID. * ordered by action ID. Loads also the lazy
* {@link Action#getDistributionSet()} field.
* *
* @param target * @param target
* to search for * to search for

View File

@@ -35,21 +35,15 @@ import org.eclipse.persistence.annotations.CascadeOnDelete;
/** /**
* <p> * <p>
* Applicable transition changes of the software {@link SoftwareModule} state of * Applicable transition changes of the {@link SoftwareModule}s state of a
* a {@link Target}, e.g. install, uninstall, update, start, stop, and * {@link Target}, e.g. install, uninstall, update and preparations for the
* preparations for the transition change, i.e. download. * transition change, i.e. download.
* </p> * </p>
* *
* <p> * <p>
* Actions are managed by the SP server (SPS) and applied to the edge controller * Actions are managed by the SP server and applied to the targets by the
* by the SP controller (SPC). Actions may also be value added commands that are * client.
* nor directly related to SP, e.g. factory reset.
* <p> * <p>
*
*
*
*
*
*/ */
@Table(name = "sp_action", indexes = { @Index(name = "sp_idx_action_01", columnList = "tenant,distribution_set"), @Table(name = "sp_action", indexes = { @Index(name = "sp_idx_action_01", columnList = "tenant,distribution_set"),
@Index(name = "sp_idx_action_02", columnList = "tenant,target,active"), @Index(name = "sp_idx_action_02", columnList = "tenant,target,active"),