Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/AnuragVanam/Geoweaver int…
Browse files Browse the repository at this point in the history
…o pr/137
  • Loading branch information
ZihengSun committed Mar 28, 2021
2 parents 03fa091 + 3307a5f commit 1aee32a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
7 changes: 4 additions & 3 deletions src/main/java/com/gw/database/HostRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;

import com.gw.jpa.Host;

public interface HostRepository extends CrudRepository<Host, String>{

@Query(value="select * from hosts where owner = ?1 ",
@Query(value="select * from host where owner = ?1 ",
nativeQuery = true)
Collection<Host> findByOwner(String owner);

@Query(value="select * from hosts where name like '%?1%'",
@Query(value="select * from HOST where name like CONCAT('%',:keyword,'%')",
nativeQuery = true)
Collection<Host> findHostsByNameAlike(String keyword);
Collection<Host> findHostsByNameAlike(@Param("keyword") String keyword);



Expand Down
5 changes: 3 additions & 2 deletions src/main/java/com/gw/database/ProcessRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;

import com.gw.jpa.GWProcess;
import com.gw.jpa.Host;

public interface ProcessRepository extends CrudRepository<GWProcess, String>{

@Query(value = "select * from GWProcess where name like '%?1%'",
@Query(value = "select * from GWProcess where name like CONCAT('%',:keyword,'%')",
nativeQuery = true)
Collection<GWProcess> findProcessesByNameAlike(String keyword);
Collection<GWProcess> findProcessesByNameAlike(@Param("keyword") String keyword);

@Query(value="select * from gwprocess where description = 'python'",
nativeQuery = true)
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/com/gw/database/WorkflowRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;

import com.gw.jpa.GWProcess;
import com.gw.jpa.Workflow;

public interface WorkflowRepository extends CrudRepository<Workflow, String>{

@Query(value="select * from workflow where name like '%?1%'",
@Query(value="select * from workflow where name like CONCAT('%',:keyword,'%')",
nativeQuery=true)
Collection<Workflow> findProcessesByNameAlike(String keyword);
Collection<Workflow> findProcessesByNameAlike(@Param("keyword") String keyword);

}

0 comments on commit 1aee32a

Please sign in to comment.