Dependdancies, Model, Class and POM.xml edits
This commit is contained in:
@@ -19,21 +19,24 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
<version>${spring.boot.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Spring Data JPA -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||
<version>${spring.boot.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Database Driver (e.g., H2, MySQL, PostgreSQL) -->
|
||||
<dependency>
|
||||
<groupId>com.h2database</groupId> <!-- Change this to your database -->
|
||||
<artifactId>h2</artifactId>
|
||||
<scope>runtime</scope>
|
||||
<groupId>org.mariadb.jdbc</groupId>
|
||||
<artifactId>mariadb-java-client</artifactId>
|
||||
<version>3.1.2</version> <!-- Check for the latest version if needed -->
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- Spring Boot Starter Test -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
|
@@ -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
|
||||
|
BIN
BrickLog-Server/target/BrickLog-Server-0.1-SNAPSHOT.jar
Normal file
BIN
BrickLog-Server/target/BrickLog-Server-0.1-SNAPSHOT.jar
Normal file
Binary file not shown.
Binary file not shown.
3
BrickLog-Server/target/maven-archiver/pom.properties
Normal file
3
BrickLog-Server/target/maven-archiver/pom.properties
Normal file
@@ -0,0 +1,3 @@
|
||||
artifactId=BrickLog-Server
|
||||
groupId=com.example
|
||||
version=0.1-SNAPSHOT
|
@@ -0,0 +1 @@
|
||||
com\example\bricklog\BrickLogApplication.class
|
@@ -0,0 +1 @@
|
||||
C:\Users\bryce\Documents\Git\BrickLog\BrickLog-Server\src\main\java\com\example\bricklog\BrickLogApplication.java
|
Reference in New Issue
Block a user