Category: Eclipse

  • JPA OneToMany Unidirectional with Join Table

    In earlier post we had OneToMany bi-directional mapping. In this post we will see how can we make it unidirectional with the usage of a JoinTable. Let’s create our eclipse project and then add update our pom.xml. pom.xml [sourcecode language=”xml”] <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot; xmlns="http://maven.apache.org/POM/4.0.0&quot; xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd&quot; > <modelVersion>4.0.0</modelVersion> <groupId>com.mumz.test.hibernatesearch</groupId> <artifactId>MumzHibernateSearch</artifactId> <version>0.0.1-SNAPSHOT</version> <packaging>jar</packaging> <name>MumzHibernateSearch</name> <url>http://maven.apache.org</url&gt; <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>…

  • Integrating Spring Security 3.1 and JSF 2.0

    Today in this tutorial we will integrate our JSF 2.0 application with Spring Security 3.1. We will be using the basic security feature of Spring Security and later on we will expand on this. What we need JDK Eclipse Spring Core Spring Security Some additional jars Project Creation Create a new “Dynamic Web Project” In…

  • Integrate LDAP and Spring Security 3.1 for Authentication and Authorization in a JSF 2.0 Application.

    Backtracking all our previous tutorial you will notice we always had our user definition with password placed in our database. Not every time this will be the case and frequently we will have to integrate our application with LDAP. In this tutorial we will integrate our earlier application with Apache Directory Services. If you don’t…

  • Configuring Apache DS in Eclipse

    Lightweight Directory Access Protocol aka LDAP is a protocol used for maintaining data over distributed ENV. Most of the organization will use LDAP for holding there user information and more often then not in almost all our application we will authenticate user against LDAP. In this post we will configure Apache Directory which is built…

  • Create Lucene Index in database using JdbcDirectory

    In our last post we built a simple index over file system. While our example works fine but cannot be extended over clustered environment and also cannot be used for a large document because of memory foot print. Lucene doesn’t provide a direct in built JDBC interface but Compass does, though the JDBC interface of…

  • Integrating Apache Lucene and Maven in Eclipse

    In two steps we will integrate Apache Lucene and Maven in Eclipse. First Create Java Project using Maven in Eclipse Second add lucene dependency in your pom.xml, so you pom.xml should look like this: pom.xml [sourcecode language=”xml”] <project xmlns="http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation= "http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt; <modelVersion>4.0.0</modelVersion> <groupId>com.mumz.test.lucene</groupId> <artifactId>ApacheLuceneTest</artifactId> <version>0.0.1-SNAPSHOT</version> <name>ApacheLuceneTest</name> <description>ApacheLuceneTest</description> <dependencies> <dependency> <artifactId>lucene-core</artifactId> <groupId>org.apache.lucene</groupId> <type>jar</type> <version>3.6.1</version> </dependency>…

  • Audit Framework with Spring AOP and JPA

    Every now and then we come across a common requirement of building an Audit framework. In simple words it means whenever a record is added, edited or removed there should be an entry made in a separate table so that different actions of users can be monitored. Today in this tutorial we will build an…

  • Spring AOP using Annotation

    AOP a.k.a Aspect Oriented programming using Spring is a common usage now. In a nutshell it provides common functionality to be weaved into beans. Functionalities like logging before and after method is executed instead of being part of actual method implementation can be wired. Some important notes about AOP with Spring: Spring AOP is implemented…

  • JPA OneToMany Mapping Using Hibernate and MySQL

    OneToMany as name suggest is the scenario where one entity can be linked to multiple entities. For e.g. one BookShelf can contain multiple books. In this tutorial we will use the same problem statement and model it using JPA with Hibernate as the JPA implementation provider. First we will write our simple BookShelf entity, BookShelf…

  • JPA Unidirectional One to One Mapping using MySQL

    In this tutorial we will explore how to map two entities. Say we have two entity Employee and Address, every employee will have one associated address, association will look like: JPA supports multiple types of mapping, in this tutorial we will see how to do “Uni-Directional” One to One Mapping. First we will setup our…