Skip to content

Commit

Permalink
Add javadoc and fixed some errors
Browse files Browse the repository at this point in the history
Adapt queries to the updates made in TaskCreateUPreprocessing (delete  preprocessDataset attribute)
  • Loading branch information
mnloures committed Feb 18, 2020
1 parent b1464ea commit 6554cb8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
6 changes: 5 additions & 1 deletion src/main/java/org/strep/domain/Task.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,12 @@ public class Task implements Serializable {
@GeneratedValue(strategy = GenerationType.IDENTITY)
private long id;

// No caso de TaskCreateSDataset o que se fai é que o dataset que está en task actua como o dataset que hai que encher cos arquivos que se pasan no ficheiro zip. Básicamente sería un parámetro de E/S (entrada/salida). Este Dataset de salida instanciase no spring e despois échese no strep_service.
/**
* The dataset associated to this task
* The dataset associated to this task. Depending on the type of task, the dataset will behave on different way.
* Preprocessing task (TaskCreateUPreprocessing) : This is an input dataset
* System task (TaskCreateSDataset) : This is an Input/output dataset. This dataset is filled with zip file content.
* Tune task (TaskCreateUDataset): Output dataset which contains the combination/filtering of instances made through executing the task
*/
@ManyToOne(optional = true, fetch = FetchType.EAGER)
@JoinColumn(name = "dataset_name")
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/org/strep/repositories/TaskRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ public interface TaskRepository extends CrudRepository<Task, Long> {
*/
@Query(value = "SELECT t "
+ "FROM TaskCreateUPreprocessing t, Dataset d "
+ "WHERE d.name=t.preprocessDataset.name "
+ "AND t.preprocessDataset.name<>?1 AND (d.access IN ('public','protected') OR d.author=?2) "
+ "WHERE d.name=t.dataset.name "
+ "AND t.dataset.name<>?1 AND (d.access IN ('public','protected') OR d.author=?2) "
+ "AND t.state=?3")
public ArrayList<TaskCreateUPreprocessing> findAllTaskCreateUPreprocessing(String datasetName, String username, String state);

Expand Down Expand Up @@ -170,7 +170,7 @@ public interface TaskRepository extends CrudRepository<Task, Long> {
* @return a list with the preprocessing tasks of the dataset filtered by
* state
*/
@Query(value = "SELECT t FROM TaskCreateUPreprocessing t WHERE t.preprocessDataset=?1 AND t.state=?2 AND t.active='1'")
@Query(value = "SELECT t FROM TaskCreateUPreprocessing t WHERE t.dataset.name=?1 AND t.state=?2 AND t.active='1'")
public ArrayList<TaskCreateUPreprocessing> getActivePreprocessingTasks(Dataset dataset, String state);

/**
Expand All @@ -182,7 +182,7 @@ public interface TaskRepository extends CrudRepository<Task, Long> {
* @return a list with the preprocessing tasks of the dataset filtered by
* state
*/
@Query(value = "SELECT t FROM TaskCreateUPreprocessing t WHERE t.preprocessDataset=?1 AND t.state=?2")
@Query(value = "SELECT t FROM TaskCreateUPreprocessing t WHERE t.dataset.name=?1 AND t.state=?2")
public ArrayList<TaskCreateUPreprocessing> getPreprocessingTasks(Dataset dataset, String state);

/**
Expand All @@ -193,7 +193,7 @@ public interface TaskRepository extends CrudRepository<Task, Long> {
* @return a list with the preprocessing tasks of the dataset filtered by
* state
*/
@Query(value = "SELECT t FROM TaskCreateUPreprocessing t WHERE t.state=?1 ORDER BY t.preprocessDataset")
@Query(value = "SELECT t FROM TaskCreateUPreprocessing t WHERE t.state=?1 ORDER BY t.dataset.name")
public ArrayList<TaskCreateUPreprocessing> getPreprocessingTasks(String state);

/**
Expand Down

0 comments on commit 6554cb8

Please sign in to comment.