So I finally found some time to make a 2.1 release for EoD SQL. For those who don’t already know:
EoD SQL Allows for fast, simple binding between a Relation Database Query and Java objects.
Think of it as your friend that gets Hibernate or JPA out-of-your-face and lets you get on with actually writing some code.
The 2.1 release has a long list of changes behind it (which we’ve built over the last few months).
- It’s much faster than EoD SQL 2.0 was (which in turn was faster than 1.0).
- There are a good number of bug-fixes, making it nice and stable.
- The 2.1 release includes batch updates
@Update(sql=”INSERT INTO users (name, email) VALUES (?{1.name}, ?{1.email})”,batchUpdate=true)
void batchInsertUsers(Collection users) throws SQLException; - GWT developers rejoice! EoD SQL can now fetch objects in any Collection type you choose!
@Select(“SELECT * FROM users WHERE group = ?1″)
ArrayList getUsersInGroup(long groupId); - Byte arrays are now considered primitive types, and get mapped by EoD SQL out-of-the-box (no custom TypeMapper required)
That’s far from an exhaustive list, and you should really go download the API and try out some of the cool new features.
February 9, 2010 at 3:15 pm
Hi,
I like this initiative. And thank you for taking the time and making it happen. It does give a lot of flexibility. Do you have a fully functioning example of GWT CRUD screen interacting with EoD SQL? That would be great. Thank you.
February 16, 2010 at 1:15 pm
I second that, full GWT example will be nice. If I find way how to write my app, I will post it.
February 18, 2010 at 6:23 am
Hey there.
I’m really busy with my day-job at the moment, so I really just don’t have time to put together a nice GWT / EoD-SQL demo.
As soon as I’ve got some more time on my hands, you can be sure I’ll put something together and post it.
February 18, 2010 at 4:16 pm
Hi Jason,
thanks for response. There is one thing unclear in tutorial (at least to me). This connection (datasource) code should be where? In ServiceImpl.java file? It looks weird, because this connection code will be called every time client request data…or?
February 19, 2010 at 6:45 am
There are several options on where to put the datasource code, depending on whether you use one of more databases.
If you only use one database (which is the 90% case), I would advise setting up the EoD SQL Default Data Source (QueryTool.setDefaultDataSource).
If you are using more than one database, you will need to open each Query with a specific DataSource (QueryTool.getQuery(DataSource, Class)).
Finally: where to put this code. I generally find that the best place to lookup (JNDI) or open my connections is in a ServletContextListener. The primary advantage is that it’s then not tied to any one Servlet, and is started before any other structures. You could however also place that code in the init() method of your Servlet (ServiceImpl).
February 22, 2010 at 7:29 am
Thanks. It was my poor understanding of java what caused this question. I didn’t know about ServletContextListener, it looks like proper way to do any “startup” code.