Checkpoint - started to create database entities
This commit is contained in:
parent
481922dbd3
commit
c96d6d8380
@ -1,13 +0,0 @@
|
||||
package com.plannaplan;
|
||||
|
||||
/**
|
||||
* Hello world!
|
||||
*
|
||||
*/
|
||||
public class App
|
||||
{
|
||||
public static void main( String[] args )
|
||||
{
|
||||
System.out.println( "Hello World!" );
|
||||
}
|
||||
}
|
26
buisnesslogic/src/main/java/com/plannaplan/Assigner.java
Normal file
26
buisnesslogic/src/main/java/com/plannaplan/Assigner.java
Normal file
@ -0,0 +1,26 @@
|
||||
package com.plannaplan;
|
||||
|
||||
import com.plannaplan.interfaces.Historable;
|
||||
import com.plannaplan.interfaces.ProtectedAction;
|
||||
|
||||
public class Assigner implements Historable, ProtectedAction {
|
||||
|
||||
public Assigner() {
|
||||
}
|
||||
|
||||
public void assing() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validateAction() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addActionToHistory() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
package com.plannaplan;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
|
||||
@Entity
|
||||
public class Book {
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
private Long id;
|
||||
private String name;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
// standard constructors
|
||||
|
||||
// standard getters and setters
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
package com.plannaplan;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public interface BookRepository extends JpaRepository<Book, Long> {
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
package com.plannaplan;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class BookService {
|
||||
|
||||
@Autowired
|
||||
private BookRepository bookRepository;
|
||||
|
||||
public List<Book> list() {
|
||||
return bookRepository.findAll();
|
||||
}
|
||||
}
|
20
buisnesslogic/src/main/java/com/plannaplan/Configurator.java
Normal file
20
buisnesslogic/src/main/java/com/plannaplan/Configurator.java
Normal file
@ -0,0 +1,20 @@
|
||||
package com.plannaplan;
|
||||
|
||||
import com.plannaplan.interfaces.ProtectedAction;
|
||||
import com.plannaplan.models.ConfigData;
|
||||
|
||||
public class Configurator implements ProtectedAction {
|
||||
|
||||
public Configurator() {
|
||||
}
|
||||
|
||||
public void config(ConfigData data) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validateAction() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
30
buisnesslogic/src/main/java/com/plannaplan/Controller.java
Normal file
30
buisnesslogic/src/main/java/com/plannaplan/Controller.java
Normal file
@ -0,0 +1,30 @@
|
||||
package com.plannaplan;
|
||||
|
||||
public class Controller {
|
||||
public Controller() {
|
||||
}
|
||||
|
||||
public void startApp() {
|
||||
}
|
||||
|
||||
public void assignCourse() {
|
||||
}
|
||||
|
||||
public void addUnavailibility() {
|
||||
}
|
||||
|
||||
public void addGroup() {
|
||||
}
|
||||
|
||||
public void editGroup() {
|
||||
}
|
||||
|
||||
public void getHistoryAtPoint() {
|
||||
}
|
||||
|
||||
public void config() {
|
||||
}
|
||||
|
||||
public void createTransfer() {
|
||||
}
|
||||
}
|
26
buisnesslogic/src/main/java/com/plannaplan/GroupAdder.java
Normal file
26
buisnesslogic/src/main/java/com/plannaplan/GroupAdder.java
Normal file
@ -0,0 +1,26 @@
|
||||
package com.plannaplan;
|
||||
|
||||
import com.plannaplan.interfaces.Historable;
|
||||
import com.plannaplan.interfaces.ProtectedAction;
|
||||
|
||||
public class GroupAdder implements Historable, ProtectedAction {
|
||||
|
||||
public GroupAdder() {
|
||||
}
|
||||
|
||||
public void addGroup() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addActionToHistory() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validateAction() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
19
buisnesslogic/src/main/java/com/plannaplan/GroupEditor.java
Normal file
19
buisnesslogic/src/main/java/com/plannaplan/GroupEditor.java
Normal file
@ -0,0 +1,19 @@
|
||||
package com.plannaplan;
|
||||
|
||||
import com.plannaplan.interfaces.ProtectedAction;
|
||||
|
||||
public class GroupEditor implements ProtectedAction {
|
||||
|
||||
public GroupEditor() {
|
||||
}
|
||||
|
||||
public void setNewCapacity(int capaity) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validateAction() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.plannaplan;
|
||||
|
||||
import com.plannaplan.interfaces.ProtectedAction;
|
||||
|
||||
public class HistoryResolver implements ProtectedAction {
|
||||
|
||||
public HistoryResolver() {
|
||||
}
|
||||
|
||||
public void getHistoryAtPoint() {
|
||||
}
|
||||
|
||||
public void reproduce() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validateAction() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
package com.plannaplan;
|
||||
|
||||
public class SampleClass {
|
||||
private String xd;
|
||||
|
||||
public SampleClass(String xd) {
|
||||
this.setXd(xd);
|
||||
}
|
||||
|
||||
public String getXd() {
|
||||
return xd;
|
||||
}
|
||||
|
||||
public void setXd(String xd) {
|
||||
this.xd = xd;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.plannaplan;
|
||||
|
||||
import com.plannaplan.interfaces.Historable;
|
||||
import com.plannaplan.interfaces.ProtectedAction;
|
||||
|
||||
public class TransferCreator implements Historable, ProtectedAction {
|
||||
|
||||
public TransferCreator() {
|
||||
}
|
||||
|
||||
public void createTransfer() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validateAction() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addActionToHistory() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.plannaplan;
|
||||
|
||||
import com.plannaplan.interfaces.Historable;
|
||||
import com.plannaplan.interfaces.ProtectedAction;
|
||||
|
||||
public class UnavailabilityAdder implements Historable, ProtectedAction {
|
||||
|
||||
public UnavailabilityAdder() {
|
||||
}
|
||||
|
||||
public void add() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validateAction() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addActionToHistory() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package com.plannaplan.configutils;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class FileToDatabaseMigrator {
|
||||
public FileToDatabaseMigrator() {
|
||||
}
|
||||
|
||||
public void migrate(File file) {
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
package com.plannaplan.entities;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
|
||||
@Entity
|
||||
public class Groups {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
private Long id;
|
||||
private Long courseId;
|
||||
private int time;
|
||||
private String room;
|
||||
private int capacity;
|
||||
|
||||
public Groups() {
|
||||
}
|
||||
|
||||
public int getCapacity() {
|
||||
return capacity;
|
||||
}
|
||||
|
||||
public void setCapacity(int capacity) {
|
||||
this.capacity = capacity;
|
||||
}
|
||||
|
||||
public String getRoom() {
|
||||
return room;
|
||||
}
|
||||
|
||||
public void setRoom(String room) {
|
||||
this.room = room;
|
||||
}
|
||||
|
||||
public int getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
public void setTime(int time) {
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
public Long getCourseId() {
|
||||
return courseId;
|
||||
}
|
||||
|
||||
public void setCourseId(Long courseId) {
|
||||
this.courseId = courseId;
|
||||
}
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
package com.plannaplan.interfaces;
|
||||
|
||||
public interface EventCreator {
|
||||
void update();
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
package com.plannaplan.interfaces;
|
||||
|
||||
public interface Historable {
|
||||
void addActionToHistory();
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
package com.plannaplan.interfaces;
|
||||
|
||||
public interface ProtectedAction {
|
||||
void validateAction();
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package com.plannaplan.models;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Date;
|
||||
|
||||
public class ConfigData {
|
||||
private Date start;
|
||||
private Date end;
|
||||
private File file;
|
||||
|
||||
public ConfigData(Date start, Date end, File file) {
|
||||
this.start = start;
|
||||
this.end = end;
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
public File getFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
public Date getEnd() {
|
||||
return end;
|
||||
}
|
||||
|
||||
public Date getStart() {
|
||||
return start;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package com.plannaplan.repositories;
|
||||
|
||||
import com.plannaplan.entities.Groups;
|
||||
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public interface GroupRepository extends JpaRepository<Groups, Long> {
|
||||
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
package com.plannaplan.services;
|
||||
|
||||
import com.plannaplan.repositories.GroupRepository;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class GroupService {
|
||||
@Autowired
|
||||
private GroupRepository repo;
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package com.plannaplan.statisticutils;
|
||||
|
||||
public class Statistics {
|
||||
|
||||
public Statistics() {
|
||||
}
|
||||
|
||||
public void getAll() {
|
||||
}
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
package com.plannaplan;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import org.junit.Ignore;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
/**
|
||||
* Unit test for simple App.
|
||||
*/
|
||||
public class AppTest {
|
||||
@Autowired
|
||||
private BookService bookService;
|
||||
|
||||
@Ignore
|
||||
@Test
|
||||
public void whenApplicationStarts_thenHibernateCreatesInitialRecords() {
|
||||
List<Book> books = bookService.list();
|
||||
|
||||
Assert.assertEquals(books.size(), 1);
|
||||
}
|
||||
}
|
@ -1,8 +1,10 @@
|
||||
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
|
||||
spring.datasource.url=jdbc:mysql://172.20.0.2:3306/test
|
||||
spring.datasource.url=jdbc:mysql://172.20.0.3:3306/test?useUnicode=yes&characterEncoding=UTF-8
|
||||
spring.datasource.username=root
|
||||
spring.datasource.password=example
|
||||
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
spring.jpa.open-in-view=true
|
||||
spring.jpa.hibernate.ddl-auto=create
|
||||
spring.jackson.serialization.fail-on-empty-beans=false
|
||||
|
||||
server.port=1285
|
Loading…
Reference in New Issue
Block a user