Dependdancies, Model, Class and POM.xml edits
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
package com.example.bricklog.model;
|
||||
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.GeneratedValue;
|
||||
import jakarta.persistence.GenerationType;
|
||||
import jakarta.persistence.Id;
|
||||
|
||||
@Entity
|
||||
public class LegoBuild {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
private String name;
|
||||
private String builder;
|
||||
private boolean isKitset; // true for Kitset, false for MoC
|
||||
private String description;
|
||||
|
||||
public LegoBuild() {}
|
||||
|
||||
public LegoBuild(String name, String builder, boolean isKitset, String description) {
|
||||
this.name = name;
|
||||
this.builder = builder;
|
||||
this.isKitset = isKitset;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
// Getters and setters...
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getBuilder() {
|
||||
return builder;
|
||||
}
|
||||
|
||||
public void setBuilder(String builder) {
|
||||
this.builder = builder;
|
||||
}
|
||||
|
||||
public boolean isKitset() {
|
||||
return isKitset;
|
||||
}
|
||||
|
||||
public void setKitset(boolean isKitset) {
|
||||
this.isKitset = isKitset;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
}
|
@@ -0,0 +1,19 @@
|
||||
package com.example.bricklog.repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.example.bricklog.model.LegoBuild;
|
||||
|
||||
@Repository
|
||||
public interface LegoBuildRepository extends JpaRepository<LegoBuild, Long> {
|
||||
|
||||
List<LegoBuild> findByBuilderContainingIgnoreCase(String builder);
|
||||
|
||||
List<LegoBuild> findByNameContainingIgnoreCase(String name);
|
||||
|
||||
List<LegoBuild> findByNameContainingIgnoreCaseOrBuilderContainingIgnoreCase(String name, String builder);
|
||||
}
|
||||
|
@@ -0,0 +1,9 @@
|
||||
# MariaDB Configuration
|
||||
spring.datasource.url=jdbc:mariadb://localhost:3306/bricklog_db
|
||||
spring.datasource.username=your_db_username
|
||||
spring.datasource.password=your_db_password
|
||||
|
||||
# JPA settings
|
||||
spring.jpa.hibernate.ddl-auto=update # Creates tables automatically; set to 'none' in production if not needed
|
||||
spring.jpa.show-sql=true # Shows SQL queries in the console, useful for debugging
|
||||
spring.jpa.database-platform=org.hibernate.dialect.MariaDBDialect
|
||||
|
Reference in New Issue
Block a user