Matt RaibleMatt Raible is a Web Developer and Java Champion. Connect with him on LinkedIn.

The Angular Mini-Book The Angular Mini-Book is a guide to getting started with Angular. You'll learn how to develop a bare-bones application, test it, and deploy it. Then you'll move on to adding Bootstrap, Angular Material, continuous integration, and authentication.

Spring Boot is a popular framework for building REST APIs. You'll learn how to integrate Angular with Spring Boot and use security best practices like HTTPS and a content security policy.

For book updates, follow @angular_book on Twitter.

The JHipster Mini-Book The JHipster Mini-Book is a guide to getting started with hip technologies today: Angular, Bootstrap, and Spring Boot. All of these frameworks are wrapped up in an easy-to-use project called JHipster.

This book shows you how to build an app with JHipster, and guides you through the plethora of tools, techniques and options you can use. Furthermore, it explains the UI and API building blocks so you understand the underpinnings of your great application.

For book updates, follow @jhipster-book on Twitter.

10+ YEARS


Over 10 years ago, I wrote my first blog post. Since then, I've authored books, had kids, traveled the world, found Trish and blogged about it all.

Hibernate Enhancements

For you Hibernate users/lovers, here's some good news for you (THANKS GAVIN!):

1. [Hibernate Forum] For XDoclet users its well-worth grabbing a CVS update now, I have fixed a bunch of issues and made improvements including Hibernate2 support (thanks to Matt Raible) and joined-subclass support.

2. [Hibernate Dev List]

 After a bit of research and thinking, I have settled on an approach to
 query by Criteria that hopefully is flexible enough for 80-90% of use
 cases, but still simple enough to fit in sufficiently few lines of code.
 
 The proposed new API is based loosely upon the Cayenne API. Queries may be
 expressed as follows:
 
 
 List cats = session.createCriteria(Cat.class)
     .add( Expression.like("name", "Izi%" ) )
     .add( Expression.between("weight", minWeight, maxWeight) )
     .add( Expression.eq( "mate", mate ) )
     .addOrder( Order.asc("age") )
     .setMaxResults(20)
     .list();
 
 
 Which is approximately equivalent to:
 
 from Cat cat
 where cat.name like 'Izi%'
 and cat.weight between :minWeight and :maxWeight
 and cat.mate = :mate
 order by cat.age
 
 
 This API is marked "experimental", but I would like to stabilize it fairly
 soon, so early feedback is very welcome. This is all in CVS.

Posted in Java at Mar 09 2003, 09:56:16 AM MST 3 Comments
Comments:

This is very very cool. I am still reading Hibernate docs trying to learn all that I can. One source that I am using is struts-resume. I have a question, why pass around session? What is the reason for not putting currentSession() in BaseDAOHibernate? The session is a Hibernate session, hence Hibernate specific. So all of the work that you put in to have an abstract implementation is for naught because I doubt other persistance layers are going to use a Hibernate Session. You are also tying your View to your Model. Or have I totally nuked this and am missing something?

Posted by Carl on March 09, 2003 at 09:01 PM MST #

It's a good point, but I only want to create/obtain one session per web request. If I do it on the service or DAO level, then I'd have to do it on a method level, rather than passing it around. What would be better is to pass around some generic connection object that could be a database connection, a hibernate session or something like that. That's probably the route I should go. Thanks for the feedback - keep it coming!

Posted by Matt Raible on March 09, 2003 at 10:46 PM MST #

Why not save it in a ThreadLocal? That's what I'm doing at work and in the beginnings of XRoller (our XWork / WW2 version of Roller)

Posted by Anonymous on March 11, 2003 at 07:45 PM MST #

Post a Comment:
  • HTML Syntax: Allowed