I'm using hibernate + play! framework at work, is there a "best practice" on inserting a good amount of records using hibernate? They are around 6,000 to 10,000 per text file so I don't know if ...

String query = "Select count(*) from product where date_added in (?)"; Object[] params = {dates}; //dates is a list of java.sql.Date Long productCount = jdbcTemplate.queryForObject(query, params, ...

I'm trying to swap two ints - x and y in the example, and do it in one line without a library function. So I started with this: int x = 4; int y = 3; System.out.println(x); System.out.println(y); ...

My Background is C++ and in c++ we can easily create array of object using simple syntax. className obj[n]; and also constructor will call n time. But When I tried to create array of object in java ...

I know my code can be simpler and more efficient... My code is supposed to grab the biggest set of 5 digits. It works, except it only is grabbing 3 digits, what would i need to modify to change that? ...

I am refactoring others code. The one thing I notice is that of the manner on how the system is getting a connection from the connection pool. Sample is like this. On every call of the service ...

I am using Spring Redis support to save my objects in Redis. I have several DAOs which handle different Model classes: For example, ShopperHistoryDao save/retrieve objects of ShopperHistoryModel, ...

First I know this is quite dirty job, and if there is a way, it may be consider "bad practice". Unfortunately, I have to explore the possibility. I would like to know if I can cast an object that in ...

I have the following JAVA method implemented due a interface: public String importDocument(ImportSource source, Map<String, ? extends Object> paramMap); When i try to do following, i get an ...