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> <version>1.9.13</version>
</dependency> </dependency>
<dependency> <!--<dependency>-->
<groupId>com.loafle</groupId> <!--<groupId>com.loafle</groupId>-->
<artifactId>overflow_jpa_member_dao</artifactId> <!--<artifactId>overflow_jpa_agent_dao</artifactId>-->
<version>1.0.0-SNAPSHOT</version> <!--<version>1.0.0-SNAPSHOT</version>-->
</dependency> <!--</dependency>-->
<dependency> <dependency>
<groupId>com.loafle</groupId> <groupId>com.loafle</groupId>
<artifactId>overflow_jpa_agent_dao</artifactId> <artifactId>overflow_jpa_dao</artifactId>
<version>1.0.0-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
</dependency> </dependency>

View File

@ -1,12 +1,16 @@
package com.loafle.overflow.proxy.db; package com.loafle.overflow.proxy.db;
import com.loafle.overflow.agent.dao.JPAAgentDAO; 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.commons.dao.JPABaseDAO;
import com.loafle.overflow.db.api.DBGrpc; import com.loafle.overflow.db.api.DBGrpc;
import com.loafle.overflow.db.api.DBInput; import com.loafle.overflow.db.api.DBInput;
import com.loafle.overflow.db.api.DBOutput; import com.loafle.overflow.db.api.DBOutput;
import com.loafle.overflow.member.dao.JPAMemberDAO; import com.loafle.overflow.member.dao.JPAMemberDAO;
import com.loafle.overflow.noauthagent.dao.JPANoAuthAgentDAO;
import io.grpc.ServerBuilder; import io.grpc.ServerBuilder;
import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jackson.map.ObjectMapper;
@ -34,9 +38,13 @@ public class DBProxy {
daoMap = new ConcurrentHashMap(); daoMap = new ConcurrentHashMap();
JPAMemberDAO memberDao = new JPAMemberDAO(); JPAMemberDAO memberDao = new JPAMemberDAO();
JPAAgentDAO agentDao = new JPAAgentDAO(); JPAAgentDAO agentDao = new JPAAgentDAO();
JPANoAuthAgentDAO jpaNoAuthAgentDAO = new JPANoAuthAgentDAO();
JPAApiKeyDao jpaApiKeyDao = new JPAApiKeyDao();
daoMap.put("member", memberDao); daoMap.put("member", memberDao);
daoMap.put("agent", agentDao); daoMap.put("agent", agentDao);
daoMap.put("noauthAgent", jpaNoAuthAgentDAO);
daoMap.put("apiKey", jpaApiKeyDao);
} }
public void start(int port) throws IOException { 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"> xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="overflow"> <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.agent.model.Agent</class>
<class>com.loafle.overflow.noauthagent.model.NoAuthAgent</class>
<properties> <properties>
<property name="javax.persistence.jdbc.url" value="jdbc:postgresql://192.168.1.106:5432/postgres" /> <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" /> <property name="javax.persistence.jdbc.driver" value="org.postgresql.Driver" />