parent
b988036706
commit
5d29a2d3fb
@ -1,42 +1,42 @@ |
|||||||
<?xml version="1.0" encoding="UTF-8"?> |
<?xml version="1.0" encoding="UTF-8"?> |
||||||
<classpath> |
<classpath> |
||||||
<classpathentry kind="src" output="target/classes" path="src/main/java"> |
<classpathentry kind="src" output="target/classes" path="src/main/java"> |
||||||
<attributes> |
<attributes> |
||||||
<attribute name="optional" value="true"/> |
<attribute name="optional" value="true"/> |
||||||
<attribute name="maven.pomderived" value="true"/> |
<attribute name="maven.pomderived" value="true"/> |
||||||
</attributes> |
</attributes> |
||||||
</classpathentry> |
</classpathentry> |
||||||
<classpathentry kind="src" path="src/main/resources"/> |
<classpathentry kind="src" path="src/main/resources"/> |
||||||
<classpathentry kind="src" output="target/test-classes" path="src/test/java"> |
<classpathentry kind="src" output="target/test-classes" path="src/test/java"> |
||||||
<attributes> |
<attributes> |
||||||
<attribute name="test" value="true"/> |
<attribute name="test" value="true"/> |
||||||
<attribute name="optional" value="true"/> |
<attribute name="optional" value="true"/> |
||||||
<attribute name="maven.pomderived" value="true"/> |
<attribute name="maven.pomderived" value="true"/> |
||||||
</attributes> |
</attributes> |
||||||
</classpathentry> |
</classpathentry> |
||||||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> |
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"> |
||||||
<attributes> |
<attributes> |
||||||
<attribute name="maven.pomderived" value="true"/> |
<attribute name="test" value="true"/> |
||||||
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/> |
<attribute name="maven.pomderived" value="true"/> |
||||||
</attributes> |
</attributes> |
||||||
</classpathentry> |
</classpathentry> |
||||||
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"> |
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"> |
||||||
<attributes> |
<attributes> |
||||||
<attribute name="test" value="true"/> |
<attribute name="maven.pomderived" value="true"/> |
||||||
<attribute name="maven.pomderived" value="true"/> |
</attributes> |
||||||
</attributes> |
</classpathentry> |
||||||
</classpathentry> |
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> |
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"> |
<attributes> |
||||||
<attributes> |
<attribute name="maven.pomderived" value="true"/> |
||||||
<attribute name="maven.pomderived" value="true"/> |
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/> |
||||||
</attributes> |
</attributes> |
||||||
</classpathentry> |
</classpathentry> |
||||||
<classpathentry kind="src" output="target/classes" path="target/generated-resources/gwt"> |
<classpathentry kind="src" output="target/classes" path="target/generated-resources/gwt"> |
||||||
<attributes> |
<attributes> |
||||||
<attribute name="ignore_optional_problems" value="true"/> |
<attribute name="ignore_optional_problems" value="true"/> |
||||||
<attribute name="maven.pomderived" value="true"/> |
<attribute name="optional" value="true"/> |
||||||
<attribute name="optional" value="true"/> |
<attribute name="maven.pomderived" value="true"/> |
||||||
</attributes> |
</attributes> |
||||||
</classpathentry> |
</classpathentry> |
||||||
<classpathentry kind="output" path="target/classes"/> |
<classpathentry kind="output" path="target/classes"/> |
||||||
</classpath> |
</classpath> |
||||||
|
|||||||
@ -1,21 +0,0 @@ |
|||||||
import java.sql.Connection; |
|
||||||
import java.sql.DatabaseMetaData; |
|
||||||
import java.sql.SQLException; |
|
||||||
|
|
||||||
import com.mysql.cj.jdbc.MysqlDataSource; |
|
||||||
|
|
||||||
public class Main { |
|
||||||
|
|
||||||
public static void main(String[] args) throws SQLException { |
|
||||||
MysqlDataSource dataSource = new MysqlDataSource(); |
|
||||||
dataSource.setUrl( |
|
||||||
"jdbc:mysql://localhost:3306/clubhelper?useSSL=FALSE&useUnicode=yes&characterEncoding=utf8&serverTimezone=UTC"); |
|
||||||
dataSource.setUser("root"); |
|
||||||
dataSource.setPassword("07!73"); |
|
||||||
try (Connection conn = dataSource.getConnection()) { |
|
||||||
DatabaseMetaData meta = conn.getMetaData(); |
|
||||||
System.out.println(meta); |
|
||||||
} |
|
||||||
} |
|
||||||
|
|
||||||
} |
|
||||||
@ -0,0 +1,60 @@ |
|||||||
|
package de.kreth.vaadin.clubhelper.vaadinclubhelper.business; |
||||||
|
|
||||||
|
import java.util.Collection; |
||||||
|
import java.util.List; |
||||||
|
|
||||||
|
import org.slf4j.Logger; |
||||||
|
import org.slf4j.LoggerFactory; |
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.stereotype.Component; |
||||||
|
|
||||||
|
import de.kreth.vaadin.clubhelper.vaadinclubhelper.dao.PersonDao; |
||||||
|
import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Adress; |
||||||
|
import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Contact; |
||||||
|
import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Person; |
||||||
|
import de.kreth.vaadin.clubhelper.vaadinclubhelper.data.Relation; |
||||||
|
|
||||||
|
@Component |
||||||
|
public class PersonBusiness { |
||||||
|
|
||||||
|
private final Logger log = LoggerFactory.getLogger(getClass()); |
||||||
|
|
||||||
|
@Autowired |
||||||
|
private PersonDao dao; |
||||||
|
|
||||||
|
public void save(Person edited) { |
||||||
|
dao.save(edited); |
||||||
|
log.info("Saved {}", edited); |
||||||
|
} |
||||||
|
|
||||||
|
public void delete(Contact c) { |
||||||
|
dao.delete(c); |
||||||
|
log.info("Deleted {}", c); |
||||||
|
} |
||||||
|
|
||||||
|
public Collection<? extends Relation> findRelationsFor(Person person) { |
||||||
|
log.info("Loading relations of {}", person); |
||||||
|
return dao.findRelationsFor(person); |
||||||
|
} |
||||||
|
|
||||||
|
public void delete(Adress a) { |
||||||
|
dao.delete(a); |
||||||
|
log.info("Deleted {}", a); |
||||||
|
} |
||||||
|
|
||||||
|
public List<Person> listAll() { |
||||||
|
log.info("Loading all Persons"); |
||||||
|
return dao.listAll(); |
||||||
|
} |
||||||
|
|
||||||
|
public void delete(Person c) { |
||||||
|
dao.delete(c); |
||||||
|
log.info("Deleted {}", c); |
||||||
|
} |
||||||
|
|
||||||
|
public Person findLoginUser(String username, String password) { |
||||||
|
log.info("Identifiing Login for user {}", username); |
||||||
|
return dao.findLoginUser(username, password); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
Loading…
Reference in new issue