Friday May 12, 2006

SourceForge - CVS server down for a week and up with different host name!

CVS server is many times down. The last was on the end of last week. The server is up again today. But with a small difference. The host name of my cvs server has been chaged. What's mean for me? I was developing for a week without commit. I will have to checkout the cvs repository to other folder on my local disk. Copy changed files from old cvs checkout to new folder. SourceForge have many other problems. I started lookong for new opensource provider. When I find them I'll move the nbxdoclet project.

Hibernate plugin for NetBeans updated

Today was updated Hibernate plugin for NetBeans 5.x. It's is available on its update center . Few bugfixes and new features were integrated:

Customizing velocity templates of wizards. All templates are written in Velocity language (I would like to switch to Freemaker engine in future. FreeMaker is more powerful than Velocity.). The Templates browser is available from main menu ( Window|Show Velocity Teplates). The templates can be changed in editor. Opened editor with hibernate11relation is below on the screenshot. If someone know how to improve the code of templates he can send me his new version.

HQL wizard for EJB3 query language. UI is the same like for HQL wizard. Only the wizard is available in code completion of facade for EJB3 POJO.

User hibernate properties for hibernate project extension. The Hibernate project extension generated default hibernate properties file. It was difficult to change the properties manually. So I decided to merge the generated properties with new user properties. The user properties are available from popup of Hibernate project extension.

Creating Hibernate util when the facade is created. There was a usability problem. When user wanted to create new hibernate facade the HibernateUtil class had to already created. The HibernateUtil wizard is now shown when the HibernateUtil is not presented in project on creating facade from code completion. The facade class is automatically opened in editor after creating. It's expected behaviour, I hope.

Friday Apr 28, 2006

Hibernate plugin in NetBeans 5.5

I've started to migrate features from hibernate plugin based on xdoclet to javax.persistence (EJB30) annotations. Working with annotations is simpler that working with xdoclet tags. It is necessary to run post processing tool for sources with xdoclet tags and to generate xml descriptors. The annotations are stored do classes. Therefore there is no need to generate xml meta data. The EJB30 is standard. It is another reason why to use them because you are not depenedend on only one implementation. You can simply move to other vendors.

I added templates for POJO with @Entity annotations. Screenshot with code completion is shown bellow.

The ui of customizer is the same like for xdoclet customizer. Only different code is generated. For example wizard for creating 1-N relation is shown bellow.

I plan also migrate the HQL wizard to EJB30 stuff. I may be add another hibernate features to NetBeans 5.5 ( Hibernate Validator and Hibernate Lucene Integration. I looked also on JBoss Seam. It is interesting technology. Has anyone experience with it?

Friday Apr 21, 2006

NBXdoclet met annotations

Nbxdoclet allows to change property for many xdoclet tags at once. It is described at this page. I've implemented this feature for annotations. The feature can be for example used in order to change groups value of TestNG Test annotation property. Look at the screenshot.

Three testcases (methods) are selected in the explorer. The @Test tag is shown in the XDoclet Tags window. Properties of @Test annotations are shown in the property sheet. The <Different Values> is shown for timeOut property because the property is defined only in method2. Change of any annotation's property is applied to all selected methods.

Thursday Apr 13, 2006

NBXdoclet cooperates with Hibernate Query Tool for NetBeans

Hibernate Query Tool (hts) is amazing tool with these feature:

  • Session factory management
  • Powerful HQL editor with syntax coloring, code completion, Java to HQL (and reverse) formatting features
  • Powerful query result browse
  • HQL 2 SQL translation
  • EXPLAIN PLAN for the Oracle9 dialect

Leon Chiver is author of hts.

It so cool tool that I had to integrate it with my hibernate plugin for NetBeans 5.0. My plugin provide creating POJO object, facades and helps to setup hibernate dialects. Leon's plugin helps to create and trace queries.

I added a action to Hibernate project extension.

The action opens hts session for active project with hibernate support.

The code completion is really great. This feature will be available on my update center next week.


Friday Mar 31, 2006

Xdoclet 1.2.3 and JDK 1.5 features - hot fix

XDoclet 1.2.3 building fails when are used in java sources with jdk 1.5 language enhancements (Enum, annotations,...). How to solve it? I found solution at XJD-41:

Replace the xjavadoc-1.x.jar library with javadoc-1.1-j5-v4.jar

If somebody want to use jdk 1.5 features in nbxdoclet hibernate plugin he will have to replace the xjavadoc-1.x.jar jar file of xjavadoc-1.x.jar library with javadoc-1.1-j5-v4.jar jar file in Tools|Library Manager.

Saturday Mar 25, 2006

Hibernate Query Wizard for Netbeans 5.0

Hibernate is equipped with an extremely powerful query language that (quite intentionally) looks very much like SQL. But don't be fooled by the syntax; HQL is fully object-oriented, understanding notions like inheritance, polymorphism and association.

HQL Wizard for NetBeans 5.0 helps to create selects in HQL. The wizard is part of hibernate plugin based on xdoclet. The project pages are on nbxdoclet website. The HQL wizard can be open be using code completion of hibernate bean's (POJO) facade class.

The wizard is shown bellow:

Detailed steps how to create the query in the example:

  1. To create first join select USER -> N-1: Address address property in entities view and click to Add button. The address is added to Entities list.
  2. To add first Left Parameter select address -> town item and click to Add button.
  3. Type ? to First right parameter.
  4. To create second join select User -? N-1: Car car item and click to Add button.
  5. Add two user -> age rows. It is similiar like adding car -> type row.
  6. To add first parentheses select car.typ="fiat" and user.age > 20 rows and click to Set Or button.
  7. To add second parentheses select user.age < 50 and user.age > 20 rows and click to Set And button.
  8. Change generated method name to getFiatForTown.

After click to Ok button code, shown bellow, is generated to facade class:

 public java.util.List getFiatForTown(java.lang.String addressTown) {
        Session session = store.HibernateUtil.currentSession();
        org.hibernate.Query query = session.createQuery(
                " select user " +
                " from  " +
                " User as user " +
                " join user.address as address " +
                " join user.car as car " +
                "  where  " +
                " address.town = ? " +
                "  and  (car.type = \\"fiat\\" " +
                "  OR  (user.age < 50 " +
                "  AND user.age > 20) " +
                " ) ");
        query.setParameter(0,addressTown);
        
        return query.list();
    }

The wizard read the information about entities (POJO) from xdoclet tags. It it not so difficult to implement reading of EJB30 annotations. I'm not sure if someone wants to use it with annotations. Is this wizard handy? Please give me feedback and report bugs to nbxdoclet's bug tracing system.

About

xzajo

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today