chore: Refactor dataset class and dataRepository interface
- Rename dataset.java to Dataset.java - Update references to Dataset class
This commit is contained in:
@@ -10,7 +10,7 @@ import jakarta.persistence.GenerationType;
|
|||||||
import jakarta.persistence.Id;
|
import jakarta.persistence.Id;
|
||||||
|
|
||||||
@Entity
|
@Entity
|
||||||
public class dataset {
|
public class Dataset {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||||
@@ -35,21 +35,20 @@ public class dataset {
|
|||||||
|
|
||||||
private String[] Categories;
|
private String[] Categories;
|
||||||
|
|
||||||
public dataset(String title, String abst, String description, String author, Date date, String[] categories, Type type) {
|
public Dataset(String title, String abst, String description, String author, Date date, String[] categories, Type type) {
|
||||||
|
|
||||||
this.raiting = 0;
|
this.raiting = 0;
|
||||||
this.votes = 0;
|
this.votes = 0;
|
||||||
this.title = title;
|
setTitle(title);
|
||||||
this.abst = abst;
|
setAbst(abst);
|
||||||
this.description = description;
|
setDescription(description);
|
||||||
this.author = author;
|
setAuthor(author);
|
||||||
this.date = date;
|
setDate(date);
|
||||||
this.Categories = categories;
|
setCategories(categories);
|
||||||
this.type = type;
|
setType(type);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public dataset() {
|
public Dataset() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -114,7 +113,7 @@ public class dataset {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setTitle(String title) {
|
public void setTitle(String title) {
|
||||||
this.title = title;
|
this.title = title.substring(0, Math.min(title.length(), 50));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setType(Type type) {
|
public void setType(Type type) {
|
@@ -5,20 +5,20 @@ import java.util.UUID;
|
|||||||
import java.sql.Date;
|
import java.sql.Date;
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
public interface dataRepository extends JpaRepository<dataset, UUID>{
|
public interface dataRepository extends JpaRepository<Dataset, UUID>{
|
||||||
|
|
||||||
List<dataset> findByTitle(String title);
|
List<Dataset> findByTitle(String title);
|
||||||
List<dataset> findByTitleLike(String title);
|
List<Dataset> findByTitleLike(String title);
|
||||||
List<dataset> findByAuthorLike(String author);
|
List<Dataset> findByAuthorLike(String author);
|
||||||
List<dataset> findByType(Type type);
|
List<Dataset> findByType(Type type);
|
||||||
List<dataset> findByAutor(String author);
|
List<Dataset> findByAutor(String author);
|
||||||
List<dataset> findByAbstLike(String abst);
|
List<Dataset> findByAbstLike(String abst);
|
||||||
List<dataset> findByDescriptionLike(String description);
|
List<Dataset> findByDescriptionLike(String description);
|
||||||
List<dataset> findByCategoriesContainingIgnoreCase(String[] categories);
|
List<Dataset> findByCategoriesContainingIgnoreCase(String[] categories);
|
||||||
List<dataset> findByRaitingGreaterThan(float raiting);
|
List<Dataset> findByRaitingGreaterThan(float raiting);
|
||||||
List<dataset> findByVotesGreaterThan(int votes);
|
List<Dataset> findByVotesGreaterThan(int votes);
|
||||||
List<dataset> findByDateAfter(Date date);
|
List<Dataset> findByDateAfter(Date date);
|
||||||
List<dataset> findByDateBefore(Date date);
|
List<Dataset> findByDateBefore(Date date);
|
||||||
List<dataset> findByDateBetween(Date date1, Date date2);
|
List<Dataset> findByDateBetween(Date date1, Date date2);
|
||||||
|
|
||||||
}
|
}
|
Reference in New Issue
Block a user