diff --git a/BrickLog-Server/pom.xml b/BrickLog-Server/pom.xml index 96841d2..0426d42 100644 --- a/BrickLog-Server/pom.xml +++ b/BrickLog-Server/pom.xml @@ -19,21 +19,24 @@ org.springframework.boot spring-boot-starter-web + ${spring.boot.version} org.springframework.boot spring-boot-starter-data-jpa + ${spring.boot.version} - com.h2database - h2 - runtime + org.mariadb.jdbc + mariadb-java-client + 3.1.2 + org.springframework.boot diff --git a/BrickLog-Server/src/main/java/com/example/bricklog/model/LegoBuild.java b/BrickLog-Server/src/main/java/com/example/bricklog/model/LegoBuild.java new file mode 100644 index 0000000..0792eba --- /dev/null +++ b/BrickLog-Server/src/main/java/com/example/bricklog/model/LegoBuild.java @@ -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; + } +} diff --git a/BrickLog-Server/src/main/java/com/example/bricklog/repository/LegoBuildRepository.java b/BrickLog-Server/src/main/java/com/example/bricklog/repository/LegoBuildRepository.java new file mode 100644 index 0000000..f38f884 --- /dev/null +++ b/BrickLog-Server/src/main/java/com/example/bricklog/repository/LegoBuildRepository.java @@ -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 { + + List findByBuilderContainingIgnoreCase(String builder); + + List findByNameContainingIgnoreCase(String name); + + List findByNameContainingIgnoreCaseOrBuilderContainingIgnoreCase(String name, String builder); +} + diff --git a/BrickLog-Server/src/main/java/resources/application.properties b/BrickLog-Server/src/main/java/resources/application.properties index e69de29..a1ade11 100644 --- a/BrickLog-Server/src/main/java/resources/application.properties +++ b/BrickLog-Server/src/main/java/resources/application.properties @@ -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 diff --git a/BrickLog-Server/target/BrickLog-Server-0.1-SNAPSHOT.jar b/BrickLog-Server/target/BrickLog-Server-0.1-SNAPSHOT.jar new file mode 100644 index 0000000..954b99b Binary files /dev/null and b/BrickLog-Server/target/BrickLog-Server-0.1-SNAPSHOT.jar differ diff --git a/BrickLog-Server/target/classes/com/example/bricklog/BrickLogApplication.class b/BrickLog-Server/target/classes/com/example/bricklog/BrickLogApplication.class new file mode 100644 index 0000000..df8026a Binary files /dev/null and b/BrickLog-Server/target/classes/com/example/bricklog/BrickLogApplication.class differ diff --git a/BrickLog-Server/target/maven-archiver/pom.properties b/BrickLog-Server/target/maven-archiver/pom.properties new file mode 100644 index 0000000..2213d7d --- /dev/null +++ b/BrickLog-Server/target/maven-archiver/pom.properties @@ -0,0 +1,3 @@ +artifactId=BrickLog-Server +groupId=com.example +version=0.1-SNAPSHOT diff --git a/BrickLog-Server/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/BrickLog-Server/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..6fe0d0c --- /dev/null +++ b/BrickLog-Server/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1 @@ +com\example\bricklog\BrickLogApplication.class diff --git a/BrickLog-Server/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/BrickLog-Server/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..d61b148 --- /dev/null +++ b/BrickLog-Server/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1 @@ +C:\Users\bryce\Documents\Git\BrickLog\BrickLog-Server\src\main\java\com\example\bricklog\BrickLogApplication.java diff --git a/BrickLog-Server/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst b/BrickLog-Server/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst new file mode 100644 index 0000000..e69de29 diff --git a/BrickLog-Server/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst b/BrickLog-Server/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst new file mode 100644 index 0000000..e69de29