background preloader

Java

Facebook Twitter

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. We'll leave detailed features and side-steps to other sections of this manual. In this tutorial you will learn to create a complete Web application from scratch using Roo. The application we are going to develop will demonstrate many of the core features offered by Roo. In particular you will learn how to use the Roo shell for: 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. Standard MVC web application with JPA entities etcSpring Security usage, including login page customisationSending emails via SMTPTesting both via JUnit and SeleniumUsage with EclipseCreating a WAR for deployment You can find the wedding tutorial at 2.3. 2.4.

> mkdir pizza > cd pizza pizza> 2.5. What is JBehave? Cucumber - Making BDD fun. Draw UML diagrams Online | Online UML Tool | UML Diagram Creator. Java web development tutorials. JSF 2.0 + Spring + Hibernate integration example. Here’s a long article to show you how to integrate JSF 2.0, Spring and Hibernate together. At the end of the article, you will create a page which display a list of the existing customer from database and a “add customer” function to allow user to add a new customer into database. P.S In this example, we are using MySQL database and deploy to Tomcat 6 web container. 1. Project Structure Directory structure of this example 2. Create a customer table and insert 2 dummy records. DROP TABLE IF EXISTS `mkyongdb`. 3. A model class and Hibernate mapping file for customer table. File : Customer.java package com.mkyong.customer.model; import java.util.Date; public class Customer{ public long customerId; public String name; public String address; public Date createdDate; //getter and setter methods } File : Customer.hbm.xml 4.

Spring’s BO and DAO classes for business logic and database interaction. File : CustomerBo.java File : CustomerBoImpl.java File : CustomerDao.java File : CustomerDaoImpl.java 5. 6. <? 8. PrimeFaces. A blog about Programming, Web Development, Technologies & Internet. 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. 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. The search is over. 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. Project Kenai — We're More Than Just a Forge. JavaWorld.