Giter Club home page Giter Club logo

feedingmonitor's Introduction

FeedingMonitor

Webanwendungen um einzelne Fütterungen in eine Datenbank einzutragen und die dazu gehörigen Stammdaten zu pflegen

Vorbereitung

  1. Welches JDK ist installiert?
java -version
=> OpenJDK 1.8
whereis java

Spring Initialisieren auf https://start.spring.io/

=> für Ubuntu 18 kommt nur Java 11 in Frage! Nicht mekr kompatibel mit v17

=> Spring Boot 3.x würde Java 17 benötigen, daher mit v2.7.14 weiter!

Installierte Abhängigkeiten: Spring Boot DevTools, Spring Web, Thymeleaf, Spring Data JPA (u.a. Hibernate ORM), Flyway Migration

Templating + ORM

Alternative zu Thymeleaf ist JSP (Java Server Pages), ist schon in Spring dabei

Aufruf:

http://localhost:8080/

Flyway Tutorial (Flyway von redgate)

Die Migrationsskripte müssen selbst erstellt werden!

spring.flyway.locations=/home/stephan/Documents/FeedingMonitor/demo/src/main/resources/db/migration => Zugangsdaten DB nur flyway.xxx (ohne spring prefix)

mvn flyway:info -e -Dflyway.configFiles=/home/stephan/flyway.conf

https://www.baeldung.com/database-migrations-with-flyway

  • maven plugin in pom.xml hinzufügen, kann auf unterschiedliche Arten konfiguriert werden (dort Name, Passwort, Datenbank hinterlegen)

Migration ausführen:

mvn clean flyway:migrate -Dflyway.configFiles=myFlywayConfig.conf  (clean nur initial bei erstem Aufruf, leert die Datenbank!)

Java Pfad muss gesetzt sein:

export JAVA_HOME="/home/stephan/openjdk/v13/jdk-13.0.2"

mvn flyway:migrate -Dflyway.configFiles=src/main/resources/flyway.conf

Anmerkungen:

Wenn Spaltennamen ohne `` dann wird CamelCase ignoriert: brandName => brandname

Versionierungsskript sehr DB-abhängig, z.B. was int auto_increment (MySQL) betrifft => serial (4 bytes) oder bigserial (8 bytes ) in Postgresql!

Although convenient, and even suggested in many PostgreSQL books, the SERIAL and BIGSERIAL column types are not a very good choice when using JPA and Hibernate. Using a SEQUENCE generator is a better alternative since the identifier can be generated prior to executing the INSERT statement.

feedingmonitor's People

Contributors

sk359 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.