Archive for category SPRING


public class MainController extends SpringBootServletInitializer {

protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(MainController.class);

public static void main(String[] args) throws Exception {, args);

public MappingJackson2HttpMessageConverter mappingJackson2HttpMessageConverter() {
ObjectMapper mapper = new ObjectMapper();
mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
MappingJackson2HttpMessageConverter converter =
new MappingJackson2HttpMessageConverter(mapper);
return converter;


, , ,

Leave a comment

EntityManager Batch insert

public class BatchRepository<T extends MyEntity> {

private EntityManager em;

public List<T> saveList(List<T> list) {

Session session = (Session) em.getDelegate();
Transaction tx = session.beginTransaction();

for (int i = 0; i < list.size(); i++) {
T t = list.get(i);
if (t.getId() == null) {;
} else {

return list;

Leave a comment

Difference between Oracle jdbc driver classes?

For Oracle 9i onwards you should use oracle.jdbc.OracleDriver rather than oracle.jdbc.driver.OracleDriver as Oracle have stated that oracle.jdbc.driver.OracleDriver is deprecated and support for this driver class will be discontinued in the next major release.


Leave a comment