From 83eb995d69867c1c2c85b81125760546fa00861a Mon Sep 17 00:00:00 2001 From: bryce Date: Sun, 27 Oct 2024 22:49:47 +1300 Subject: [PATCH] Dependdancies, Model, Class and POM.xml edits --- BrickLog-Server/pom.xml | 9 ++- .../com/example/bricklog/model/LegoBuild.java | 70 ++++++++++++++++++ .../repository/LegoBuildRepository.java | 19 +++++ .../java/resources/application.properties | 9 +++ .../target/BrickLog-Server-0.1-SNAPSHOT.jar | Bin 0 -> 2913 bytes .../bricklog/BrickLogApplication.class | Bin 0 -> 1035 bytes .../target/maven-archiver/pom.properties | 3 + .../compile/default-compile/createdFiles.lst | 1 + .../compile/default-compile/inputFiles.lst | 1 + .../default-testCompile/createdFiles.lst | 0 .../default-testCompile/inputFiles.lst | 0 11 files changed, 109 insertions(+), 3 deletions(-) create mode 100644 BrickLog-Server/src/main/java/com/example/bricklog/model/LegoBuild.java create mode 100644 BrickLog-Server/src/main/java/com/example/bricklog/repository/LegoBuildRepository.java create mode 100644 BrickLog-Server/target/BrickLog-Server-0.1-SNAPSHOT.jar create mode 100644 BrickLog-Server/target/classes/com/example/bricklog/BrickLogApplication.class create mode 100644 BrickLog-Server/target/maven-archiver/pom.properties create mode 100644 BrickLog-Server/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst create mode 100644 BrickLog-Server/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst create mode 100644 BrickLog-Server/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst create mode 100644 BrickLog-Server/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst 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 0000000000000000000000000000000000000000..954b99b4951f11b189b285b79313085d0f48851f GIT binary patch literal 2913 zcmWIWW@h1HVBlb2IJYr6k^u>D0@=Q0f!1by(; z@je^;p@=7lDK%u3l%ur^@#K6D}3@SZbK7<+J zSWu9YnVeXXnV+YZoRe5w+#Bqhf7wBx_O`zH!7YkQm$G^tE*CoRo4HAAtDx-yj#bOJ z+UH$+cP%HodhOR;TkN^{8Z16A{|M~ZI9Y4$6K1``=o#RHv7 ziuZNv*sSh&UiM%;q&4?S;Bj5{b=|ikl3rv9f6_74;`Hz7cq*QIZpZqqPY++J)SbL) z=A1S6<$NT+Do;$^yEuE^LfubQa~(yC76@zW>%4#c#HDqoV4cePsW18u@0F6;@p!?@ zB-ZkL4TC*r*7S6Co%3wJS{S?Zr`^?!AyHjBws)Aeon3t|+Bx&w(#(}>T)zk}dR!SN z`}#&f!TqDmHYpJ+8xjk+KAA0=7Jgflw@>2PuU`>HI{YC@_D?qIpG~|d=v=&jS+KVy z@MztmIh*H)x=rH$R~}}2s^m9 zF`o>@>Zgko?e#x;Fx2B@PeV+6N>MyZy3!PvobHe>YFbs{T2;XoHf_%QD}SUN=vwYl zHo0t0nA_``@9a0O8~y2cq`6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