Skip to content
Snippets Groups Projects
Commit 14f73026 authored by Oleg Semenov's avatar Oleg Semenov
Browse files

Merge remote-tracking branch 'origin/master'

parents f03996aa a25e2edc
No related branches found
No related tags found
No related merge requests found
...@@ -32,18 +32,18 @@ public class GroupManagementController { ...@@ -32,18 +32,18 @@ public class GroupManagementController {
/** // /**
* e.g. http://localhost:8080/groups/2/ // * e.g. http://localhost:8080/groups/2/
* // *
* @param id // * @param id
* @return // * @return
*/ // */
@GetMapping(value = "/groups/{id}/") // @GetMapping(value = "/groups/{id}/")
public Group findByID( // public Group findByID(
@PathVariable(value = "id") long id // @PathVariable(value = "id") long id
) { // ) {
final Group group = groupRepository.findByID(id); // final Group group = groupRepository.findByID(id);
//
return group; // return group;
} // }
} }
package thinkTogether.groupManagement.model; package thinkTogether.groupManagement.model;
import javax.persistence.*; import javax.persistence.*;
import java.sql.Date;
@Entity @Entity
@Table(schema = "playground", name = "cat")
public class Cat { public class Cat {
@Id @Id
@GeneratedValue @GeneratedValue
private Long id; private Long id;
@Column(name = "name")
private String name; private String name;
private Date date;
public Cat() { public Cat() {
} }
public Cat(String name) { public Cat(String name, Date date) {
this.name = name; this.name = name;
this.date = date;
} }
public Long getId() { public Long getId() {
...@@ -35,4 +38,12 @@ public class Cat { ...@@ -35,4 +38,12 @@ public class Cat {
public void setName(String name) { public void setName(String name) {
this.name = name; this.name = name;
} }
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
} }
...@@ -4,26 +4,24 @@ import javax.persistence.*; ...@@ -4,26 +4,24 @@ import javax.persistence.*;
import java.sql.Date; import java.sql.Date;
@Entity @Entity
@Table( @Table(name = "group")
schema = "thinktogether",
name = "group"
)
public class Group { public class Group {
private static final int serialVersion = -1230; private static final int serialVersion = -1230;
@Id @Id
@GeneratedValue @GeneratedValue
private Long ID; @Column(name = "group_id")
private Long id;
@Column(name = "Status") @Column(name = "status")
private String status; private String status;
@Column(name = "ErstellDatum") @Column(name = "erstellDatum")
private Date datum; private Date datum;
@Column(name = "modul_ID") @Column(name = "modul_id")
private int modul_id; private int modul_id;
protected Group() { protected Group() {
...@@ -36,12 +34,12 @@ public class Group { ...@@ -36,12 +34,12 @@ public class Group {
} }
public void setID(Long id) { public void setId(Long id) {
this.ID = id; this.id = id;
} }
public Long getId() { public Long getId() {
return ID; return id;
} }
public Date getDatum() { public Date getDatum() {
......
...@@ -10,7 +10,5 @@ import java.util.List; ...@@ -10,7 +10,5 @@ import java.util.List;
public interface IGroupRepository extends CrudRepository<Group, Long> { public interface IGroupRepository extends CrudRepository<Group, Long> {
public List<Group> findAll(); public List<Group> findAll();
public Group findByID(Long ID);
} }
spring.datasource.url=jdbc:mariadb://thinktogether.mariadb.database.azure.com:3306/playground spring.datasource.url=jdbc:mariadb://thinktogether.mariadb.database.azure.com:3306/playground
spring.datasource.username=Nachtkind spring.datasource.username=Nachtkind
spring.datasource.password=!13072020VerteilteSysteme spring.datasource.password=!13072020VerteilteSysteme
spring.jpa.show-sql=true
#spring.datasource.driver-class-name=org.mariadb.jdbc.Driver #spring.datasource.driver-class-name=org.mariadb.jdbc.Driver
## Keep the connection alive if idle for a long time (needed in production) ## Keep the connection alive if idle for a long time (needed in production)
#spring.datasource.testWhileIdle=true #spring.datasource.testWhileIdle=true
##Hibernate Configuration ##Hibernate Configuration
## Show or not log for each sql query ## Show or not log for each sql query
#spring.jpa.show-sql=true
## Hibernate ddl auto (create, create-drop, update): with "update" the database ## Hibernate ddl auto (create, create-drop, update): with "update" the database
## schema will be automatically updated accordingly to java entities found in ## schema will be automatically updated accordingly to java entities found in
## the project ## the project
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment