All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.walterjwhite.modules.shell.guice.query.FindMountPointByMountPointQueryBuilder Maven / Gradle / Ivy

The newest version!
package com.walterjwhite.modules.shell.guice.query;

import com.walterjwhite.datastore.api.annotation.Supports;
import com.walterjwhite.infrastructure.datastore.modules.criteria.CriteriaQueryConfiguration;
import com.walterjwhite.infrastructure.datastore.modules.criteria.query.JpaCriteriaQueryBuilder;
import com.walterjwhite.shell.api.model.MountPoint;
import com.walterjwhite.shell.api.model.MountPoint_;
import com.walterjwhite.shell.impl.query.FindMountPointByMountPointQuery;
import javax.persistence.criteria.CriteriaBuilder;
import javax.persistence.criteria.Predicate;

@Supports(FindMountPointByMountPointQuery.class)
public class FindMountPointByMountPointQueryBuilder
    extends JpaCriteriaQueryBuilder {

  @Override
  protected Predicate buildPredicate(
      CriteriaBuilder criteriaBuilder,
      CriteriaQueryConfiguration criteriaQueryConfiguration,
      FindMountPointByMountPointQuery findMountPointByMountPointQuery) {
    return criteriaBuilder.equal(
        criteriaQueryConfiguration.getRoot().get(MountPoint_.mountPoint),
        findMountPointByMountPointQuery.getMountPoint().getMountPoint());
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy