background preloader

Java Blog

Java Blog

Chapter 2. Beginning With Roo: The Tutorial Chapter 2. Beginning With Roo: The Tutorial In this chapter we'll build an app step-by-step together in a relatively fast manner so that you can see how to typically use Roo in a normal project. In this tutorial you will learn to create a complete Web application from scratch using Roo. project creationcreation and development of domain objects (JPA entities)adding fields of different types to the domain objectscreating relationships between domain objectsautomatic creation of integration testscreating workspace artifacts to import the project into your IDEautomatic scaffolding of a Web tierrunning the application in a Web containercontrolling and securing access to different views in the applicationcustomizing the look and feel of the Web UI for our business domaincreating and running Selenium testsdeployment and backup of your application 2.2. In addition to the tutorial in this chapter, we've published a separate step-by-step tutorial in the form of a blog entry. 2.3. 2.4. 2.5. 2.6.

Coreservlets.com: Java, JSF 2.0, Ajax, jQuery, Spring, Hibernate, REST, Hadoop, and GWT Training, Tutorials, Consulting, Books, & Resources Hibernate Many To Many Annotation mapping tutorial example. Bi-Directional set mapping Welcome to the Hibernate Tutorial Series. In previous tutorial we saw how to implement Many to Many relationship using XML mapping. In this tutorial we will modify the source code from previous Many To Many XML mapping tutorial and add JPA/Annotation support to it. Let us see how to implement Many-to-Many relationship in Hibernate using Annotation. 1. For this example, we will MySQL database. 2. Download the source code: Hibernate-many-to-many-set-xml.zip (9 KB) and import the project in Eclipse. 3. File: pom.xml 3. We are not going to use hibernate mapping files or hbm files as we will map the model using Java 5 Annotations. 4. We will update Employee and Meeting model classes and add Annotations to map them with database table. File: Employee.java File: Meeting.java Let us understand the annotations we used here to map Many to many relationship. @ManyToMany – Is used to create many-to-many relationship between Employee and Meeting entities. 5. File: HibernateUtil.java 6. 7. Execute example

Spring Framework Introduction The Spring Framework provides a comprehensive programming and configuration model for modern Java-based enterprise applications - on any kind of deployment platform. A key element of Spring is infrastructural support at the application level: Spring focuses on the "plumbing" of enterprise applications so that teams can focus on application-level business logic, without unnecessary ties to specific deployment environments. Features Dependency InjectionAspect-Oriented Programming including Spring's declarative transaction managementSpring MVC web application and RESTful web service frameworkFoundational support for JDBC, JPA, JMSMuch more... Quick Start Spring Framework includes a number of different modules, here we are showing spring-context which provides core functionality. Once you've set up your build with the spring-context dependency, you'll be able to do the following: hello/MessageService.java package hello; public interface MessageService { String getMessage();}

Hibernate One To Many Annotation tutorial with example. Hibernate annotations Welcome to the Hibernate Tutorial Series. In previous tutorial we saw how to implement One to Many relationship using XML mapping. In this tutorial we will modify the source code from previous One To Many XML mapping tutorial and add JPA/Annotation support to it. 1. Database Setup For this example, we will use MySQL database. 2. Download the source code: Hibernate-one-to-many-set-example.zip (9 KB) and import the project in Eclipse. 3. File: pom.xml <? 3. We are not going to use hibernate mapping files or hbm files as we will map the model using Java 5 Annotations. 4. File: Employee.java @ManyToOne annotation defines a single-valued association to another entity class that has many-to-one multiplicity. @JoinColumn is used to specify a mapped column for joining an entity association. File: Department.java @OneToMany annotation defines a many-valued association with one-to-many multiplicity. The association may be bidirectional. 5. File: hibernate.cfg.xml <? 6. 7. Output: 8. Download Source Code

Narisa.com | Software Society The search is over. Maven Getting Started Guide What is Maven? At first glance Maven can appear to be many things, but in a nutshell Maven is an attempt to apply patterns to a project's build infrastructure in order to promote comprehension and productivity by providing a clear path in the use of best practices. Maven is essentially a project management and comprehension tool and as such provides a way to help with managing: BuildsDocumentationReportingDependenciesSCMsReleasesDistribution If you want more background information on Maven you can check out The Philosophy of Maven and The History of Maven. How can Maven benefit my development process? Maven can provide benefits for your build process by employing standard conventions and practices to accelerate your development cycle while at the same time helping you achieve a higher rate of success. Now that we have covered a little bit of the history and purpose of Maven let's get into some real examples to get you up and running with Maven! How do I setup Maven? How do I use plug-ins?

Using Facelets Templates - The Java EE 6 Tutorial JavaServer Faces technology provides the tools to implement user interfaces that are easy to extend and reuse. Templating is a useful Facelets feature that allows you to create a page that will act as the base, or template, for the other pages in an application. By using templates, you can reuse code and avoid recreating similarly constructed pages. Templating also helps in maintaining a standard look and feel in an application with a large number of pages. Table 5-2 lists Facelets tags that are used for templating and their respective functionality. Table 5-2 Facelets Templating Tags For more information on Facelets templating tags, see the documentation at The Facelets tag library includes the main templating tag ui:insert. Here is an example of a template saved as template.xhtml: <! The example page defines an XHTML page that is divided into three sections: a top section, a left section, and a main section.

java - How to open jar file using open JDK?

Related: