Archive for October, 2007

About the Technical Reviewer ALLAN KENT is a

Wednesday, October 31st, 2007

About the Technical Reviewer ALLAN KENT is a born-and-bred South African, who still lives and works in Cape Town. He has been programming in various and diverse platforms for over 20 years. Most recently, while on the hunt for a viable cross-platform programming solution, Allan chanced upon REALbasic and he hasn t looked back since.
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision J2ee Web Hosting services.

About the Author (Web server on xp) JERRY LEE FORD, JR. is

Tuesday, October 30th, 2007

About the Author JERRY LEE FORD, JR. is an IT professional with over 16 years experience in the industry. His background includes roles as an automation analyst, technical manager, technical support analyst, automation engineer, security analyst, and college instructor. Jerry has a master s degree in Business Administration from Virginia Commonwealth University in Richmond, Virginia. He is an MCSE and a CISSP. Jerry is the author of 17 other books, including Microsoft Visual Basic 2005 Express Edition Programming for the Absolute Beginner, Microsoft VBScript Professional Projects, Microsoft Windows Shell Scripting and WSH Administrator s Guide, Learn VBScript: In a Weekend, Microsoft Windows Shell Script Programming for the Absolute Beginner, Learn JavaScript: In a Weekend, and Microsoft Windows XP Professional Administrator s Guide. Jerry lives in Richmond, Virginia, with his wife Mary, and their children Alexander, William, and Molly.
Check Tomcat Web Hosting services for best quality webspace to host your web application.

APPENDIX D (Web hosting services) n UPGRADING FROM HIBERNATE 2 317

Wednesday, October 24th, 2007

APPENDIX D n UPGRADING FROM HIBERNATE 2 317 n UPGRADING FROM HIBERNATE 2 317 Hibernate 2 provided a number of aids to the generation of POJOs, mapping files, and database schemas. Hibernate 3 has started a process of migrating to external support for these processes. Where these tools are retained, they can be found in the org.hibernate.tool package and its subpackages. For example, previously a facility provided by the CodeGenerator class to generate DDL from your mappings existed in Hibernate 2. This is still provided in Hibernate 3, but the fully qualified name of the SchemaExport class is now org.hibernate.tool.hbm2ddl. SchemaExport but even though the tool still exists, the generation of mapping files from POJOs in Hibernate 3 would usually be conducted by an Eclipse plug-in, or the Hibernate Tools Ant tasks. See Appendix B for an extensive discussion of the use of the Eclipse plug-ins and Ant tasks. Changes with Java 5 The latest release of Java introduced some pretty substantial changes to the language. It also introduced some incompatibilities with the previous class file format. The only significant addition to Hibernate 3 that relies directly upon a Java 5 specific feature is the annotations support. Otherwise, a 1.4 JVM will work fine. In fact, it is even possible to build Hibernate 3 for a 1.3 JVM, although a suitable binary version is no longer distributed. The use of annotation-based mapping in Hibernate 3 is discussed in depth in Chapter 6. Summary In this appendix, we examined some of the changes that have been introduced with Hibernate 3, and showed how code written for Hibernate 2 can be run in parallel with Hibernate 3, or be readily adapted to run directly under Hibernate 3.
Searching for affordable and proven webhost to host and run your servlet applications? Go to Linux Web Hosting services and you will find it.

316 APPENDIX D n UPGRADING FROM HIBERNATE (Yahoo free web hosting) 2

Wednesday, October 24th, 2007

316 APPENDIX D n UPGRADING FROM HIBERNATE 2 APPENDIX D n UPGRADING FROM HIBERNATE 2 The object retrieved from the session factory in Hibernate 3 implements both the pure Hibernate 3 org.hibernate.Session interface and a Hibernate 2 friendly org.hibernate. classic.Session interface. By using a classic Session reference instead of the usual one, you will have access to the methods that have now been deprecated. Despite their deprecated status, all of these methods are fully implemented at the present time. Most of them are backward- compatible with their Hibernate 2 counterparts but the delete(String) method has changed slightly in that deletions are no longer cascaded to associated entities. A fully converted Hibernate 3 application will not need to invoke any of these methods, so you should use a reference to the standard interface unless you re absolutely compelled by existing logic. Other deprecated features reside in the classic package and its subpackages. Notable examples are listed in Table D-2. Table D-2. Feature Replacements in Hibernate 3 Feature Location in Hibernate 3 Use in Preference Life cycle org.hibernate.classic Interceptor or event Validatable org.hibernate.classic Interceptor or event Some of the changes to Hibernate 3 have not justified the creation of a replacement class. A few methods will have been removed, replaced, or renamed. In these few cases, if you do not want to run Hibernate 2 and 3 side by side, you will be forced to update your code. When compilation produces errors, consult the javadoc API at http://hibernate.org to see whether the API has changed, and to determine how to alter your code to work in the new environment. In practice, there are few changes in the core API between versions 2 and 3, and the changes that do exist have well-signposted successors in the new API documents. Additions The Event class is new to Hibernate 3. If you are familiar with the Interceptor class (which is retained), you will have some idea of what to expect. This topic is discussed in Appendix A. The Criteria and Filter APIs have been extended considerably. These are discussed in detail in Chapter 11. The flexibility of the mappings has been improved. For example, the joinelement permits a single class to be represented by multiple tables. Support for stored procedures allows better integration with legacy databases. The mapping file format is discussed in Chapter 8, and support for stored procedures and other new features is discussed in Appendix A. Changes to Tools and Libraries As you may expect, the libraries upon which Hibernate is based have changed in version 3. Some have been added and others have been brought up to date. Rather than enumerate these here, we refer you to the lib/README.txt file in your Hibernate 3 distribution, which explains in detail whether or not individual libraries are required, and what purpose each serves.
Note: If you are looking for cheap and reliable webhost to host and run your mysql application check mysql web server services.

Florida web design - APPENDIX D n UPGRADING FROM HIBERNATE 2 315

Tuesday, October 23rd, 2007

APPENDIX D n UPGRADING FROM HIBERNATE 2 315 n UPGRADING FROM HIBERNATE 2 315 New Features and Support for Old Ones If you are a Hibernate 2 developer and you have browsed through the earlier chapters, you will have realized that Hibernate 3 offers a lot of new features. You will have also realized that some of the Hibernate 2 features that you rely on may no longer be supported in version 3. For the most part, though, this is not the case. Changes and Deprecated Features If you do not plan to take advantage of the Hibernate 3 features in any of your existing code, you can, as discussed, simply run the two versions side by side without concern. If you are prepared to make some changes to your existing code, then it is better to take the opportunity to update your existing code to use Hibernate 3 directly. In order to make this second choice a little easier, Hibernate 3 provides a number of deprecated APIs that permit fewer changes than a full-blown conversion. This reduces the immediate impact of the change, and allows you to conduct the rest of the conversion at your leisure, while still allowing you to remove the legacy Hibernate 2 libraries from your application. nTip Hibernate exceptions are now thrown as unchecked exceptions. This will not impact existing code, but you may want to revisit APIs that explicitly declare HibernateExceptions. This change is intended to increase the clarity of API signatures by removing the need for the explicit throws clause in code, which uses Hibernate but does not catch its exceptions. There are ongoing debates over the relative merits of the two approaches, but certainly the change from checked to unchecked does not introduce any incompatibilities (whereas the reverse would). Some changes to HQL have occurred between versions 2 and 3. If you have a substantial body of existing HQL syntax, you can elect to retain the old syntax. The selection is made with the hibernate.query.factoryclass configuration attribute, which selects the class to load for translating HQL into database queries. The options are listed in Table D-1. Table D-1. The HQL Processing Classes Query Factory Class HQL Version org.hibernate.hql.ast.ASTQueryTranslatorFactory 3 (default) org.hibernate.hql.classic.ClassicQueryTranslatorFactory 2 It is not possible to switch between the two query translators within a SessionFactory instance. Because HQL queries are not parsed until run time1, you will need to run extensive tests to ensure that your modified queries are correct if you decide to convert to the Hibernate 3 syntax. 1. Named queries were introduced in Hibernate 3. These are stored in the mapping file or the annotations, and are parsed on application initialization so while they are still parsed at run time, you will not need to run extensive tests to spot syntactical problems with them.
You need excellent and relaible webhost company to host your web applications? Then pay a visit to Inexpensive Web Hosting services.

314 APPENDIX D n (Web hosting contract) UPGRADING FROM HIBERNATE 2

Monday, October 22nd, 2007

314 APPENDIX D n UPGRADING FROM HIBERNATE 2 APPENDIX D n UPGRADING FROM HIBERNATE 2 This is not a coincidence in addition to the package name, there are now two versions of the DTDs for the XML configuration files. Unchanged Hibernate 2 code should use the usual mapping DTD reference of http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd And for your new Hibernate 3 code, you will use http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd Similarly, for the Hibernate configuration file, your version 2 code will use http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd And your version 3 code will use http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd nCaution If you do not update your mapping configuration from the Hibernate 2 form to the Hibernate 3 form, the time it takes to create a configuration and session factory will increase from around 20 seconds to a matter of minutes. Obviously, it will not be possible for you to have two configuration files with the same (default) name of hibernate.cfg.xml, but either version of Hibernate permits you to construct a Configuration object and then specify an explicit location for the configuration file using the configure() methods (as shown in Listing D-1). If you are using both versions of Hibernate simultaneously, you must make sure that POJOs are not passed from one version s Session object to another s. If you need to persist your old POJOs using the new version, you must update the older code to use Hibernate 3. For an explanation of how this sort of upgrade is supported by Hibernate 3, see the description of the classic API in the following section, New Features and Support for Old Ones. Listing D-1. Using an Explicitly Named Configuration File in Hibernate 3 File configFile = new File(”hibernate3.cfg.xml”); Configuration v3Config = new Configuration(); v3Config.configure(configFile); SessionFactory sessionFactory = v3Config.buildSessionFactory(); Session session = sessionFactory.openSession(); // … You should be aware that in your Hibernate 3 logic, some of the defaults for entries in the mapping file have changed. If you have logic that relies upon implicit settings, you should review your converted mapping files against the version 3 DTD to check that they will behave as expected. The most significant change is that all mappings now default to lazy loading.
From our experience, we can recommend PHP Web Hosting services, if you need affordable webhost to host and run your web application.

Web design tools - Upgrading from Hibernate 2 APPENDIX D n n

Sunday, October 21st, 2007

Upgrading from Hibernate 2 APPENDIX D n n n Upgrading from Hibernate 2 APPENDIX D n n n Hibernate 3 represents a major change from the ways of doing things in Hibernate 2. On the whole, it is a better product, and we applaud the Hibernate developers for their efforts. One particular group of users will be made nervous by all the changes: the existing users of Hibernate 2. Well, there is good news, and there is . . . no bad news! Hibernate 3 has gone the extra mile to allow earlier users to get along. In this appendix, we will discuss the differences between the two versions and explain how a Hibernate 2 user can take advantage of them without conducting a major code rewrite. Hibernate 3 does make changes: the package names have changed, the DTDs have changed, the required libraries are different, and some of the method names and signatures have been altered. Even so, we don t think that these differences will cause you much grief when upgrading to the new version. You can run Hibernate 3 on a 1.4 or later JVM quite easily. It is possible in principle to run Hibernate 3 on a 1.3 JVM, although this will require you to recompile it from the source code and find older versions of some of the libraries that it depends upon. Once you have read this appendix, we also recommend that you consult the Hibernate 3 Migration Guide in the Documentation section of the Hibernate web site (http://hibernate. org). The Hibernate team maintains and updates this section to reflect users experiences, so you can find hints and tips gathered from developers at the cutting edge of just this sort of upgrade. Package and DTD Changes The package names for Hibernate 2 have changed with Hibernate 3. Hibernate 2 used a base package of net.sf.hibernate, while Hibernate 3 uses a base package of org.hibernate. This is, in itself, a completely trivial difference you might imagine that it is purely the result of a migration from Hibernate s hosting from SourceForge (http://sf.net or http:// sourceforge.net) to their own web site (http://hibernate.org); but, in fact, there is another reason for the change. Because of the package name change, it is possible for an application to use Hibernate 2 and Hibernate 3 simultaneously, allowing legacy Hibernate 2 code to run unmodified within the same application as more recent Hibernate 3 based components. If the same package name had been used, then it would be nearly impossible to achieve this.
Check Tomcat Web Hosting services for best quality webspace to host your web application.

312 APPENDIX C n HIBERNATE AND SPRING APPENDIX (Msn web hosting)

Saturday, October 20th, 2007

312 APPENDIX C n HIBERNATE AND SPRING APPENDIX C n HIBERNATE AND SPRING


Summary The Spring Framework offers excellent support for Hibernate as a persistence mechanism. It offers excellent support for creating Hibernate-based DAOs and various convenient features to smooth over the problems that you would otherwise encounter in building web applications based around Hibernate.
Go visit our java server pages services for a reliable, lowcost webhost to satisfy all your needs.

APPENDIX C n HIBERNATE AND (Jetty web server) SPRING 311 n

Friday, October 19th, 2007

APPENDIX C n HIBERNATE AND SPRING 311 n HIBERNATE AND SPRING 311
viewPapersController createPaperController viewArticlesController createArticleController



You want to have a cheap webhost for your apache application, then check apache web hosting services.

310 APPENDIX C n HIBERNATE AND SPRING APPENDIX (Frontpage web hosting)

Thursday, October 18th, 2007

310 APPENDIX C n HIBERNATE AND SPRING APPENDIX C n HIBERNATE AND SPRING

PROPAGATION_REQUIRED,ISOLATION_READ_COMMITTED PROPAGATION_REQUIRED,ISOLATION_READ_COMMITTED




If you are in need for chaep and reliable webhost to host your website, our recommendation is http web server services.