|
|
|||||||||||||||||
Masoud Kalali's BlogFebruary 2007 ArchivesNetBeans 6 M7 released. There are some cool features available and cool modules in UC.Posted by kalali on February 22, 2007 at 02:41 AM | Permalink | Comments (1)
Google pack installer is somehow similar to new NetBeans installer. In one simple paragraph it allows you to customize what you need in one mega installer and then you can download your customized package to your local machine to install those components into your system. features that new installer has and I really like them are as follow (sure you may find some there feature that I have not mentioned )
.
![]() When you choose to install glassfish you have option to select its path, ports, and default JDK which are important options.
![]()
![]() Based on NetBeans 6 Feature Plan we will have RoR and JavaScript support in NetBeans 6 M7, so this features should be inside our downloaded IDE or in update center, lets look and see what does we have in NetBeans new project and file and also in update centers. Yes, we have JavaScript and ROR support built-in. Lets see what else we can find in update center that is not available for 5.5.* or in NetBeans 6 M7 out of the box.
OK, what that really amazed me about new modules for NetBeans IDE is Jasper Report Visual designer, Its really cool to see a report designer for jasper report integrated into NetBeans. I know that it has some basic integration but it is the initial release of this really cool module. here are some images of Jasper report designer integrated into NetBeans. the project home page is
https://jarvis.dev.java.net/ credits goes to developer of this really
required module. NetBeans 6 release is as amazing as NetBeans 5 release was.
Hibernate dynamic mapping and Dom4J enabled sessionsPosted by kalali on February 11, 2007 at 03:53 PM | Permalink | Comments (3) Hibernate from version 3.0? provide a very useful feature for people who develop application frameworks. Indeed this feature allows you to work directly with XML documents and elements which represent entities.
Imagine that you have an application or an SDK which help users to manipulate data from different RDBMSs. Hibernate provide rich configuration facilities which help you configure Hibernate dynamically in term of adding mapping data or other configuration artifacts that usually stores in hibernate.cfg.xml or equal properties files. As we are planning to use Hibernate dynamic mapping and Dom4J entity mode i am going to blog about it during my evaluation. OK, Hibernate provide 3 kinds of entity mode
<property name="default_entity_mode">dom4j</property>To hibernate.cfg.xml . but for our sample we will create a session with dom4j entity mode. you can find a complete sample for this blog entry here . Make sure that you read readme file in project folder before you go toward executing it. For this sample I used Netbeans 6.0 M6 (which really rules) and Hibernate 3.2.1 . I wont tell steps to create project, XML file or ... but just actions and core required for hibernate side. you can see project structure in the following image. As you can see it is a basic ant based project. Let me give you content of each file and explain about it as much as i could. First of all lets see what we have in hibernate.cfg.xml <?xml version='1.0' encoding='utf-8'?> <!DOCTYPE hibernate-configurationThe configuration file is a simple and traditional hibernate configuration file with pooling enabled and dialect sets to MySQL ones. We have one mapping file which is named student.hbm.xml so we include it into the configuration file. If you do not have MySQL around then use Derby which is included into NetBeans ;-) . Log4J configuration is another traditional one, as you see We used a file appender which send formatted log entry into a file named messages_dynamic.log in project root directory. next file which we are going to take a look is Student.hbm.xml it is our mapping file, where we define the student as a dynamic entity. <?xml version="1.0"?>As you can see there is just one change in mapping file, we have entity-name attribute instead of class attribute. You should know that can have both class and entity-name attribute so an entity could be dynamic or mapped to a concrete class. Next step is looking at our HibernateUtil which is known to the community for Hibernate booting and hibernate instance management. here is its code:
Noting extra here. lets look at last part in which we try to use dom4j session to manipulate our data. package dynamic; In the begging we create a session with dom4j entity mode. so it will return Dom4J elements as our entities. in next two blocks i have create two students one is Alice Cooper and the other is John connor (what does this name remind you? ;-) . we simply ask our session to save them as we do for usual POJO mode. Session know what to do with dom4j elements as it is configured as a DOM4J session. In Second block we query our table and retrieve all entities into a list, but this list is not a list of Student POJOs instead it is a list of DOM4J elements. so we need to do some XML processing when we want to extract our entity properties. you can learn more about DOM4J at Here . Next step we retrieve a single row, edit and save it into our database, Its all simple DOM4J operation which you should use over some elements to manipulate your data. Build file that i used contains two target that we will use during this project. first one is hbm2ddl which will create our database structure and the second one is run target which will execute our main class. it is not required to include build file here you can download the sample and check it yourself. make sure you look at readme file before digging into execution of application. In next few days I will try to do a simple benchmark for some simple CRUD operation to have a basic clue about DOM4J entity mode in our environment.
| |||||||||||||||||
|
|