Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.tcb.issue1</groupId>
<artifactId>Issue1</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
package com.tcb.issue1.configuration;
import com.mysql.jdbc.jdbc2.optional.MysqlDataSource;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import javax.sql.DataSource;
spring:
batch:
job:
enabled: false
data:
elasticsearch:
clusterName: adm-cluster
clusterNodes: localhost:9300
#local: true
properties:
@theflofly
theflofly / Car.java
Last active February 14, 2016 21:54
package com.tcb.issue1.model;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
/**
* This class represents a car.
package com.tcb.issue1.model;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
/**
package com.tcb.issue1.repository;
import com.tcb.issue1.model.Car;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
/**
* This class is a repository for the car object model. It abstract the data access by providing default methods to
* access data.
*
package com.tcb.issue1.repository;
import com.tcb.issue1.model.Offer;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
/**
* This class is a repository for the offer object model. It abstract the data access by providing default methods to
* access data.
*
package com.tcb.issue1.job;
import com.tcb.issue1.model.Car;
import com.tcb.issue1.repository.CarRepository;
import org.springframework.batch.item.data.AbstractPaginatedDataItemReader;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
package com.tcb.issue1.job;
import com.tcb.issue1.model.Car;
import com.tcb.issue1.model.Offer;
import org.slf4j.Logger;
import org.springframework.batch.item.ItemProcessor;
import static org.slf4j.LoggerFactory.getLogger;
/**
package com.tcb.issue1.job;
import com.tcb.issue1.model.Offer;
import com.tcb.issue1.repository.OfferRepository;
import org.springframework.batch.item.ItemWriter;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;