My Spring Boot 애플리케이션은 Spring Security OAuth2에 의해 보안됩니다. 사용자 데이터는 SQL 데이터베이스에 저장됩니다. 나는 여기서 royclarkson의 Oauth 보호 REST 서비스를 따랐다. 이 프로젝트는 Spring Data JPA와 함께 작동합니다. 이것은 잘 작동합니다.Neo4J JDBC 및 MySQL을 이용한 스프링 부트
https://github.com/royclarkson/spring-rest-service-oauth
는하지만 지금은 Neo4J - JDBC (JDBC 템플릿)을 통해 내 Neo4J - 데이터베이스에서 데이터를 얻기 위해 내 Neo4J 구성을 구현하고자합니다. 여기에 나는이 GitHub의 프로젝트 다음 :
https://github.com/neo4j-examples/movies-java-spring-boot-jdbc
작동 독립 실행 형 응용 프로그램으로,하지만 내가 togehter이 두 개의 프로젝트를 넣어 경우,이 예외 얻을 :
이HibernateJpaAutoConfiguration.class]: Invocation of init method failed;
nested exception is org.hibernate.HibernateException:
Unable to determine Dialect to use [name=Neo4j, majorVersion=3];
user must register resolver or explicitly set 'hibernate.dialect'
내 Neo4jConfig.java의 모습을 이 :
@Configuration
public class Neo4jConfig {
//NEO4J Server Implementation via JDBC
private static final String NEO4J_URL = System.getProperty("NEO4J_URL","jdbc:neo4j://localhost:7474");
private static final String NEO4J_USER = System.getProperty("NEO4J_USER","neo4j");
private static final String NEO4J_PASSWORD = System.getProperty("NEO4J_PASSWORD","neo4j");
@Bean
public DataSource dataSource() {
return new DriverManagerDataSource(NEO4J_URL, NEO4J_USER, NEO4J_PASSWORD);
}
public Neo4jConfig(){
}
public String getNeo4JURL(){
return NEO4J_URL;
}
}
TripController.java
import hello.data.Trip;
@RestController
public class TripController {
@Autowired
JdbcTemplate template;
public static final RowMapper<Trip> TRIP_ROW_MAPPER = new RowMapper<Trip>() {
public Trip mapRow(ResultSet rs, int rowNum) throws SQLException {
return new Trip(rs.getString("tripname"),rs.getInt("slots"), rs.getInt("to_date"), rs.getInt("from_date"));
}
};
String SEARCH_TRIPS_QUERY =
" MATCH (t:Trip)\n" +
" RETURN t.tripname as tripname, t.slots as slots, t.to_date as to_date, t.from_date as from_date";
@RequestMapping(path = "/alltrips", method = RequestMethod.GET)
public List<Trip> alltrips() {
return template.query(SEARCH_TRIPS_QUERY, TRIP_ROW_MAPPER);
}
}
나는 너희들이 내 질문을 이해하기를 바랍니다. 나는 봄에 정말로 새로운 사람이다. 나는 누구나 나를 도울 수 있기를 바란다 :
"두 프로젝트를 함께 넣으십시오"라는 것은 무엇을 의미합니까? 일할 때나하지 않을 때 더 잘 설명 할 수 있습니까? – visola