by Rob 12 Mar 06:49
RELEASE 0.9.6

I have just released 0.9.6. This includes...

* Bug fixes
* API Tweaks
* Validation
* Refactored internals - esp around building/executing Query

This is the last major version before dumping the deprecated Find* code and associated stuff.

12 Mar 07:42
by Rob

API
====
- Tweaked methods on Query;
.select() [deprecated setProperties]
.where(), .having() [deprecated addWhere() addHaving()]
.orderBy() - will also retain setOrderBy()

- Added basic expressions to the ExpressionList... this means you can write

Query<Order> query = ...

query
.select("... some properties...")
.join("... some assoc...");
.where()
.like("propertyName", "something%")
.gt("score", 4)
.orderBy("id desc")
.findList();

Adding the basic expressions to ExpressionList means that you don't need to use the Expr expression factory and I think makes the api pretty good. IMO these method names are reasonably intuiative and I'm not expecting changes.

Validation
==========
- I guess there are two ways this can be useful.
1. Ebean reads string max lengths and not null constraints from Database meta data and can automatically create appropriate validation. This is especially useful for JDBC batching where the errors returned can be difficult to diagnose.

2. You can put annotations like @Length, @NotNull, @Email, @Pattern etc on your bean properties and either/or ue manual validation via
Ebean.validate() or automatically during Ebean.save(). That said, its more likely you want to do this type of validation higher up in your
application if you have the opportunity.


Debugging Lazy Loading
=====================
ebean.debug.lazyload=true

If you turn this on Ebean will spit out a debug line to the console like...

debug.lazyLoad [app.data.BugStatus] id[NEW] reason[read title] at: query.UsingSqlSelect.showsNamedQuery(UsingSqlSelect.java:75)

... the neat bit is in an IDE you can typically click on the UsingSqlSelect.java:75 and go straight to the code that cause the lazy loading to fire.


Meta Data
==========
0.9.6 includes the first bit of meta data you can query out of Ebean.

// you can query the query execution statistics... there is one
// MetaQueryStatistic per SQL statement

Query<MetaQueryStatistic> query = Ebean.createQuery(MetaQueryStatistic.class);
List<MetaQueryStatistic> list = query.findList();
for (MetaQueryStatistic metaQueryStatistic : list) {
System.out.println(metaQueryStatistic);
}

The plan is that you can find the top 10 queries by ... count, total execution time or avg execution time and use that info to performance tune the app.

The meta data will be fleshed out to include the beans/properties/tables/columns/relationships etc... and this will be useful for development and admin tools.

Create a New Topic

Title:
Body:
 
Introduction User Guide (pdf) Install/Configure Public JavaDoc Whitepapers
General Database Specific Byte Code Deployment Annotations Features
Top Bugs Top Enhancements
woResponse