Skip to content
Snippets Groups Projects
Commit 5051c0ac authored by Joshua Gill's avatar Joshua Gill
Browse files

Categories Entity and Repo created

parent 17791799
No related branches found
No related tags found
3 merge requests!56tags will be saved to userFavTags table (needs user ID of current logged in user),!50Merging for latest changes,!46Develop
package com.example.clientproject.data.categories;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
/**
* Entity for the "Categories" Table
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Entity
public class Categories {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private long categoryId;
private String categoryName;
}
package com.example.clientproject.data.categories;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
/**
* Repository for the "Categories" Entity
*/
public interface CategoriesRepo extends JpaRepository<Categories, Long> {
/**
* Find all method
* @return - list of all the categories
*/
List<Categories> findALl();
/**
* Save method
* @param category - the category to save
* @return - the category
*/
Categories save(Categories category);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment