Skip to content

Commit

Permalink
BAEL-3777: Fixed some spring init issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Sorin Zamfir committed Jan 27, 2020
1 parent 44669b0 commit da869ef
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,22 @@
import java.util.Optional;
import java.util.UUID;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.baeldung.dddhexagonalspring.domain.Order;
import com.baeldung.dddhexagonalspring.domain.repository.OrderRepository;

@Component
public class CassandraDbOrderRepository implements OrderRepository {

private final SpringDataCassandraOrderRepository orderRepository;

@Autowired
public CassandraDbOrderRepository(SpringDataCassandraOrderRepository orderRepository) {
this.orderRepository = orderRepository;
}

@Override
public Optional<Order> findById(UUID id) {
// TODO Auto-generated method stub
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
import com.baeldung.dddhexagonalspring.domain.Order;
import com.baeldung.dddhexagonalspring.domain.repository.OrderRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;

import java.util.Optional;
import java.util.UUID;

@Component
@Primary
public class MongoDbOrderRepository implements OrderRepository {

private final SpringDataMongoOrderRepository orderRepository;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
import java.util.UUID;

import org.springframework.data.cassandra.repository.CassandraRepository;
import org.springframework.stereotype.Repository;

import com.baeldung.dddhexagonalspring.domain.Order;

@Repository
public interface SpringDataCassandraOrderRepository extends CassandraRepository<Order, UUID>{

}
2 changes: 1 addition & 1 deletion ddd/src/main/resources/ddd-layers.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ spring.data.mongodb.database=order-database
spring.data.mongodb.username=order
spring.data.mongodb.password=order

spring.data.cassandra.keyspaceName=order-database
spring.data.cassandra.keyspaceName=order_database
spring.data.cassandra.username=cassandra
spring.data.cassandra.password=cassandra
spring.data.cassandra.contactPoints=localhost
Expand Down

0 comments on commit da869ef

Please sign in to comment.