dao
This commit is contained in:
snoop 2017-06-04 15:11:17 +09:00
parent 98ebc21b0a
commit a255a026c9
3 changed files with 16 additions and 7 deletions

12
pom.xml
View File

@ -63,15 +63,15 @@
<version>1.9.13</version>
</dependency>
<dependency>
<groupId>com.loafle</groupId>
<artifactId>overflow_jpa_member_dao</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<!--<dependency>-->
<!--<groupId>com.loafle</groupId>-->
<!--<artifactId>overflow_jpa_agent_dao</artifactId>-->
<!--<version>1.0.0-SNAPSHOT</version>-->
<!--</dependency>-->
<dependency>
<groupId>com.loafle</groupId>
<artifactId>overflow_jpa_agent_dao</artifactId>
<artifactId>overflow_jpa_dao</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>

View File

@ -1,12 +1,16 @@
package com.loafle.overflow.proxy.db;
import com.loafle.overflow.agent.dao.JPAAgentDAO;
import com.loafle.overflow.apikey.dao.JPAApiKeyDao;
import com.loafle.overflow.commons.dao.JPABaseDAO;
import com.loafle.overflow.db.api.DBGrpc;
import com.loafle.overflow.db.api.DBInput;
import com.loafle.overflow.db.api.DBOutput;
import com.loafle.overflow.member.dao.JPAMemberDAO;
import com.loafle.overflow.noauthagent.dao.JPANoAuthAgentDAO;
import io.grpc.ServerBuilder;
import org.codehaus.jackson.map.ObjectMapper;
@ -34,9 +38,13 @@ public class DBProxy {
daoMap = new ConcurrentHashMap();
JPAMemberDAO memberDao = new JPAMemberDAO();
JPAAgentDAO agentDao = new JPAAgentDAO();
JPANoAuthAgentDAO jpaNoAuthAgentDAO = new JPANoAuthAgentDAO();
JPAApiKeyDao jpaApiKeyDao = new JPAApiKeyDao();
daoMap.put("member", memberDao);
daoMap.put("agent", agentDao);
daoMap.put("noauthAgent", jpaNoAuthAgentDAO);
daoMap.put("apiKey", jpaApiKeyDao);
}
public void start(int port) throws IOException {

View File

@ -3,8 +3,9 @@
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="overflow">
<class>com.loafle.overflow.member.model.Member</class>
<class>com.loafle.overflow.member.com.loafle.overflow.member.model.Member</class>
<class>com.loafle.overflow.agent.model.Agent</class>
<class>com.loafle.overflow.noauthagent.model.NoAuthAgent</class>
<properties>
<property name="javax.persistence.jdbc.url" value="jdbc:postgresql://192.168.1.106:5432/postgres" />
<property name="javax.persistence.jdbc.driver" value="org.postgresql.Driver" />