registration project work

This commit is contained in:
eugenp 2014-08-13 12:10:29 +03:00
parent 8118f458bc
commit af81fa53ac
20 changed files with 213 additions and 208 deletions

View File

@ -3,7 +3,6 @@ package org.baeldung.persistence.service;
import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic; import static org.apache.commons.lang3.RandomStringUtils.randomAlphabetic;
import org.baeldung.persistence.model.Foo; import org.baeldung.persistence.model.Foo;
import org.baeldung.persistence.service.IFooService;
import org.baeldung.spring.PersistenceConfig; import org.baeldung.spring.PersistenceConfig;
import org.junit.Ignore; import org.junit.Ignore;
import org.junit.Test; import org.junit.Test;
@ -36,6 +35,7 @@ public class FooServicePersistenceIntegrationTest {
} }
@Test(expected = DataIntegrityViolationException.class) @Test(expected = DataIntegrityViolationException.class)
@Ignore("work in progress")
public final void whenInvalidEntityIsCreated_thenDataException() { public final void whenInvalidEntityIsCreated_thenDataException() {
service.create(new Foo()); service.create(new Foo());
} }

View File

@ -1 +0,0 @@
/src

View File

@ -11,7 +11,7 @@
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>1.1.4.RELEASE</version> <version>1.1.5.RELEASE</version>
</parent> </parent>
<dependencies> <dependencies>
@ -137,9 +137,6 @@
</build> </build>
<properties> <properties>
<java-version>1.7</java-version> <java-version>1.7</java-version>
<org.springframework-version>3.1.1.RELEASE</org.springframework-version>
<org.springframework.security.version>3.2.4.RELEASE</org.springframework.security.version>
<org.aspectj-version>1.6.10</org.aspectj-version>
<!-- logging --> <!-- logging -->
<org.slf4j.version>1.7.6</org.slf4j.version> <org.slf4j.version>1.7.6</org.slf4j.version>
@ -152,7 +149,7 @@
<javax.inject.version>1</javax.inject.version> <javax.inject.version>1</javax.inject.version>
<!-- Spring Data Jpa --> <!-- Spring Data Jpa -->
<spring-data-jpa.version>1.4.1.RELEASE</spring-data-jpa.version> <spring-data-jpa.version>1.6.2.RELEASE</spring-data-jpa.version>
<!-- guava --> <!-- guava -->
<guava.version>17.0</guava.version> <guava.version>17.0</guava.version>

View File

@ -3,7 +3,6 @@ package org.baeldung.persistence.dao;
import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.JpaRepository;
import org.baeldung.persistence.model.User; import org.baeldung.persistence.model.User;
public interface UserRepository extends JpaRepository<User, Long> {
public interface UserRepository extends JpaRepository<User,Long>{
public User findByUsername(String username); public User findByUsername(String username);
} }

View File

@ -11,8 +11,7 @@ import javax.persistence.JoinColumn;
import javax.persistence.OneToOne; import javax.persistence.OneToOne;
import javax.persistence.Table; import javax.persistence.Table;
@Entity(name = "role")
@Entity(name="role")
@Table(name = "role") @Table(name = "role")
public class Role { public class Role {
@ -20,42 +19,49 @@ public class Role {
@GeneratedValue(strategy = GenerationType.AUTO) @GeneratedValue(strategy = GenerationType.AUTO)
private Long id; private Long id;
@OneToOne(targetEntity = User.class, fetch = FetchType.EAGER, cascade = CascadeType.ALL) @OneToOne(targetEntity = User.class, fetch = FetchType.EAGER, cascade = CascadeType.ALL)
@JoinColumn(name = "user_id") @JoinColumn(name = "user_id")
private User user; private User user;
@Column(name="role") @Column(name = "role")
private Integer role; private Integer role;
public Role(){ public Role() {
super(); super();
} }
public Role(Integer role){
public Role(Integer role) {
super(); super();
this.role = role; this.role = role;
} }
public Role(Integer role, User user){
public Role(Integer role, User user) {
super(); super();
this.role = role; this.role = role;
this.user = user; this.user = user;
} }
public Long getId() { public Long getId() {
return id; return id;
} }
public void setId(Long id) { public void setId(Long id) {
this.id = id; this.id = id;
} }
public User getUser() { public User getUser() {
return user; return user;
} }
public void setUser(User user) { public void setUser(User user) {
this.user = user; this.user = user;
} }
public Integer getRole() { public Integer getRole() {
return role; return role;
} }
public void setRole(Integer role) { public void setRole(Integer role) {
this.role = role; this.role = role;
} }

View File

@ -17,17 +17,16 @@ public class User {
@Id @Id
@GeneratedValue(strategy = GenerationType.AUTO) @GeneratedValue(strategy = GenerationType.AUTO)
private Long id; private Long id;
@Column(name="firstName") @Column(name = "firstName")
private String firstName; private String firstName;
@Column(name="lastName") @Column(name = "lastName")
private String lastName; private String lastName;
@Column(name="username") @Column(name = "username")
private String username; private String username;
@Column(name="password") @Column(name = "password")
private String password; private String password;
@OneToOne(mappedBy = "user", fetch = FetchType.EAGER, cascade = CascadeType.ALL)
@OneToOne(mappedBy = "user",fetch = FetchType.EAGER, cascade = CascadeType.ALL)
private Role role; private Role role;
public Long getId() { public Long getId() {
@ -78,7 +77,6 @@ public class User {
this.role = role; this.role = role;
} }
@Override @Override
public int hashCode() { public int hashCode() {
final int prime = 31; final int prime = 31;
@ -100,11 +98,11 @@ public class User {
return false; return false;
return true; return true;
} }
@Override @Override
public String toString() { public String toString() {
final StringBuilder builder = new StringBuilder(); final StringBuilder builder = new StringBuilder();
builder.append("User [firstName=").append(firstName).append("]"). builder.append("User [firstName=").append(firstName).append("]").append("[lastName=").append(lastName).append("]").append("[username").append(username).append("]");
append("[lastName=").append(lastName).append("]").append("[username").append(username).append("]");
return builder.toString(); return builder.toString();
} }
} }

View File

@ -1,6 +1,6 @@
package org.baeldung.persistence.service; package org.baeldung.persistence.service;
public class EmailExistsException extends Throwable{ public class EmailExistsException extends Throwable {
public EmailExistsException(String message) { public EmailExistsException(String message) {
super(message); super(message);

View File

@ -7,8 +7,6 @@ import org.hibernate.validator.constraints.NotEmpty;
public class RegistrationFormWithValidation { public class RegistrationFormWithValidation {
@Email @Email
@NotEmpty @NotEmpty
@Size(max = 100) @Size(max = 100)

View File

@ -7,8 +7,6 @@ import org.baeldung.persistence.model.Role;
import org.baeldung.persistence.model.User; import org.baeldung.persistence.model.User;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.springframework.dao.DataIntegrityViolationException;
import org.springframework.data.repository.RepositoryDefinition;
import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -16,7 +14,8 @@ import org.springframework.stereotype.Service;
public class RepositoryService implements UserService { public class RepositoryService implements UserService {
@Autowired @Autowired
private UserRepository repository; private UserRepository repository;
private PasswordEncoder passwordEncoder;
private final PasswordEncoder passwordEncoder;
@Autowired @Autowired
private Environment env; private Environment env;

View File

@ -1,4 +1,5 @@
package org.baeldung.persistence.service; package org.baeldung.persistence.service;
//Renamed original RegistrationForm //Renamed original RegistrationForm
public class UserDto { public class UserDto {
@ -17,41 +18,51 @@ public class UserDto {
public void setLastError(String lastError) { public void setLastError(String lastError) {
this.lastError = lastError; this.lastError = lastError;
} }
public Integer getRole() { public Integer getRole() {
return role; return role;
} }
public void setRole(Integer role) { public void setRole(Integer role) {
this.role = role; this.role = role;
} }
public String getUsername() { public String getUsername() {
return username; return username;
} }
public void setUsername(String username) { public void setUsername(String username) {
this.username = username; this.username = username;
} }
public String getFirstName() { public String getFirstName() {
return firstName; return firstName;
} }
public void setFirstName(String firstName) { public void setFirstName(String firstName) {
this.firstName = firstName; this.firstName = firstName;
} }
public String getLastName() { public String getLastName() {
return lastName; return lastName;
} }
public void setLastName(String lastName) { public void setLastName(String lastName) {
this.lastName = lastName; this.lastName = lastName;
} }
public String getPassword() { public String getPassword() {
return password; return password;
} }
public void setPassword(String password) { public void setPassword(String password) {
this.password = password; this.password = password;
} }
@Override @Override
public String toString() { public String toString() {
final StringBuilder builder = new StringBuilder(); final StringBuilder builder = new StringBuilder();
builder.append("User [firstName=").append(firstName).append("]"). builder.append("User [firstName=").append(firstName).append("]").append("[lastName=").append(lastName).append("]").append("[username").append(username).append("]");
append("[lastName=").append(lastName).append("]").append("[username").append(username).append("]");
return builder.toString(); return builder.toString();
} }
} }

View File

@ -1,4 +1,5 @@
package org.baeldung.persistence.service; package org.baeldung.persistence.service;
import org.baeldung.persistence.model.User; import org.baeldung.persistence.model.User;
public interface UserService { public interface UserService {

View File

@ -36,7 +36,7 @@ public class MyUserDetailsService implements UserDetailsService {
User user = userRepository.findByUsername(username); User user = userRepository.findByUsername(username);
LOGGER.debug("Found user: {}", user); LOGGER.debug("Found user: {}", user);
if (user == null) { if (user == null) {
//throw new UsernameNotFoundException("No user found with username: " + username); // throw new UsernameNotFoundException("No user found with username: " + username);
boolean enabled = false; boolean enabled = false;
return new org.springframework.security.core.userdetails.User(" ", " ", enabled, true, true, true, getAuthorities(new Integer(1))); return new org.springframework.security.core.userdetails.User(" ", " ", enabled, true, true, true, getAuthorities(new Integer(1)));
} }

View File

@ -1,6 +1,5 @@
package org.baeldung.spring; package org.baeldung.spring;
import java.util.Properties;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan;
@ -9,7 +8,6 @@ import org.springframework.context.annotation.Import;
import org.springframework.context.annotation.PropertySource; import org.springframework.context.annotation.PropertySource;
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer; import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.springframework.mail.javamail.JavaMailSenderImpl;
@Configuration @Configuration
@ComponentScan(basePackages = { "org.baeldung.persistence.service", "org.baeldung.persistence.dao" }) @ComponentScan(basePackages = { "org.baeldung.persistence.service", "org.baeldung.persistence.dao" })
@ -24,22 +22,22 @@ public class AppConfig {
return new PropertySourcesPlaceholderConfigurer(); return new PropertySourcesPlaceholderConfigurer();
} }
@Bean // @Bean
public JavaMailSenderImpl javaMailSenderImpl() { // public JavaMailSenderImpl javaMailSenderImpl() {
JavaMailSenderImpl mailSenderImpl = new JavaMailSenderImpl(); // JavaMailSenderImpl mailSenderImpl = new JavaMailSenderImpl();
mailSenderImpl.setHost(env.getProperty("smtp.host")); // mailSenderImpl.setHost(env.getProperty("smtp.host"));
mailSenderImpl.setPort(env.getProperty("smtp.port", Integer.class)); // mailSenderImpl.setPort(env.getProperty("smtp.port", Integer.class));
mailSenderImpl.setProtocol(env.getProperty("smtp.protocol")); // mailSenderImpl.setProtocol(env.getProperty("smtp.protocol"));
mailSenderImpl.setUsername(env.getProperty("smtp.username")); // mailSenderImpl.setUsername(env.getProperty("smtp.username"));
mailSenderImpl.setPassword(env.getProperty("smtp.password")); // mailSenderImpl.setPassword(env.getProperty("smtp.password"));
//
Properties javaMailProps = new Properties(); // Properties javaMailProps = new Properties();
javaMailProps.put("mail.smtp.auth", true); // javaMailProps.put("mail.smtp.auth", true);
javaMailProps.put("mail.smtp.starttls.enable", true); // javaMailProps.put("mail.smtp.starttls.enable", true);
//
mailSenderImpl.setJavaMailProperties(javaMailProps); // mailSenderImpl.setJavaMailProperties(javaMailProps);
//
return mailSenderImpl; // return mailSenderImpl;
} // }
} }

View File

@ -19,11 +19,8 @@ import org.springframework.web.servlet.i18n.LocaleChangeInterceptor;
import org.springframework.web.servlet.view.InternalResourceViewResolver; import org.springframework.web.servlet.view.InternalResourceViewResolver;
import org.springframework.web.servlet.view.JstlView; import org.springframework.web.servlet.view.JstlView;
@Configuration @Configuration
@ComponentScan(basePackages = { @ComponentScan(basePackages = { "org.baeldung.web.controller", "org.baeldung.persistence.service", "org.baeldung.persistence.dao" })
"org.baeldung.web.controller", "org.baeldung.persistence.service", "org.baeldung.persistence.dao"
})
@EnableWebMvc @EnableWebMvc
public class MvcConfig extends WebMvcConfigurerAdapter { public class MvcConfig extends WebMvcConfigurerAdapter {
@ -82,6 +79,7 @@ public class MvcConfig extends WebMvcConfigurerAdapter {
messageSource.setCacheSeconds(0); messageSource.setCacheSeconds(0);
return messageSource; return messageSource;
} }
@Bean @Bean
public UserValidator userValidator() { public UserValidator userValidator() {
UserValidator userValidator = new UserValidator(); UserValidator userValidator = new UserValidator();

View File

@ -1,7 +1,5 @@
package org.baeldung.web.controller; package org.baeldung.web.controller;
import java.util.Locale;
import org.baeldung.persistence.model.User; import org.baeldung.persistence.model.User;
import org.baeldung.persistence.service.EmailExistsException; import org.baeldung.persistence.service.EmailExistsException;
import org.baeldung.persistence.service.UserDto; import org.baeldung.persistence.service.UserDto;
@ -10,17 +8,10 @@ import org.baeldung.persistence.service.UserValidator;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.MessageSource;
import org.springframework.core.env.Environment;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.Model;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
import org.springframework.validation.Errors; import org.springframework.validation.Errors;
import org.springframework.validation.ObjectError;
import org.springframework.validation.Validator;
import org.springframework.web.bind.WebDataBinder; import org.springframework.web.bind.WebDataBinder;
import org.springframework.web.bind.annotation.InitBinder; import org.springframework.web.bind.annotation.InitBinder;
import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.ModelAttribute;
@ -30,7 +21,6 @@ import org.springframework.web.bind.annotation.SessionAttributes;
import org.springframework.web.context.request.WebRequest; import org.springframework.web.context.request.WebRequest;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
@Controller @Controller
@SessionAttributes("user") @SessionAttributes("user")
public class RegistrationController { public class RegistrationController {
@ -38,16 +28,13 @@ public class RegistrationController {
private static final Logger LOGGER = LoggerFactory.getLogger(RegistrationController.class); private static final Logger LOGGER = LoggerFactory.getLogger(RegistrationController.class);
private UserService service; private UserService service;
@Autowired @Autowired
private MessageSource messages;
@Autowired
private JavaMailSender mailSender;
@Autowired
private UserValidator validator; private UserValidator validator;
@InitBinder @InitBinder
protected void initBinder(WebDataBinder binder) { protected void initBinder(WebDataBinder binder) {
binder.setValidator(this.validator); binder.setValidator(this.validator);
} }
@Autowired @Autowired
public RegistrationController(UserService service) { public RegistrationController(UserService service) {
this.service = service; this.service = service;
@ -60,6 +47,7 @@ public class RegistrationController {
model.addAttribute("user", userDto); model.addAttribute("user", userDto);
return "registration"; return "registration";
} }
/* @RequestMapping(value ="/user/registration", method = RequestMethod.POST) /* @RequestMapping(value ="/user/registration", method = RequestMethod.POST)
public String registerUserAccount( @ModelAttribute("user") UserDto userAccountData, public String registerUserAccount( @ModelAttribute("user") UserDto userAccountData,
BindingResult result, BindingResult result,
@ -81,10 +69,8 @@ public class RegistrationController {
return "successRegister"; return "successRegister";
//return "redirect:/"; //return "redirect:/";
}*/ }*/
@RequestMapping(value ="/user/registration", method = RequestMethod.POST) @RequestMapping(value = "/user/registration", method = RequestMethod.POST)
public ModelAndView registerUserAccount( @ModelAttribute("user") UserDto userAccountData, public ModelAndView registerUserAccount(@ModelAttribute("user") UserDto userAccountData, BindingResult result, WebRequest request, Errors errors) {
BindingResult result,
WebRequest request, Errors errors) {
LOGGER.debug("Registering user account with information: {}", userAccountData); LOGGER.debug("Registering user account with information: {}", userAccountData);
validator.validate(userAccountData, result); validator.validate(userAccountData, result);
User registered = createUserAccount(userAccountData, result); User registered = createUserAccount(userAccountData, result);
@ -114,14 +100,4 @@ public class RegistrationController {
return registered; return registered;
} }
private void sendConfirmMail(String address, Locale locale){
String recipientAddress = address;
String subject = "Registration Confirmation";
String message = messages.getMessage("message.regSucc", null, locale);
SimpleMailMessage email = new SimpleMailMessage();
email.setTo(recipientAddress);
email.setSubject(subject);
email.setText(message);
mailSender.send(email);
}
} }

View File

@ -1,17 +1,10 @@
################### DataSource Configuration ########################## ################### DataSource Configuration ##########################
jdbc.driverClassName=com.mysql.jdbc.Driver jdbc.driverClassName=com.mysql.jdbc.Driver
jdbc.url=jdbc:mysql://localhost:3306/AUTHDATA jdbc.url=jdbc:mysql://localhost:3306/spring_hibernate4_02?createDatabaseIfNotExist=true
jdbc.user=root jdbc.user=tutorialuser
###jdbc.pass=admin### jdbc.pass=tutorialmy5ql
init-db=false init-db=false
################### Hibernate Configuration ########################## ################### Hibernate Configuration ##########################
hibernate.dialect=org.hibernate.dialect.MySQLDialect hibernate.dialect=org.hibernate.dialect.MySQLDialect
hibernate.show_sql=true hibernate.show_sql=false
hibernate.hbm2ddl.auto=validate hibernate.hbm2ddl.auto=create-drop
################### JavaMail Configuration ##########################
smtp.host=smtp.gmail.com
smtp.port=465
smtp.protocol=smtps
smtp.username=edson@gmail.com
smtp.password=
support.email=edson@gmail.com

View File

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>

View File

@ -1,10 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<projectDescription> <projectDescription>
<name>spring-security-login-and-registration</name> <name>spring-security-mvc-ldap</name>
<comment></comment> <comment></comment>
<projects> <projects>
</projects> </projects>
<buildSpec> <buildSpec>
<buildCommand>
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand> <buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name> <name>org.eclipse.jdt.core.javabuilder</name>
<arguments> <arguments>
@ -16,12 +21,12 @@
</arguments> </arguments>
</buildCommand> </buildCommand>
<buildCommand> <buildCommand>
<name>org.springframework.ide.eclipse.core.springbuilder</name> <name>org.eclipse.m2e.core.maven2Builder</name>
<arguments> <arguments>
</arguments> </arguments>
</buildCommand> </buildCommand>
<buildCommand> <buildCommand>
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name> <name>org.springframework.ide.eclipse.core.springbuilder</name>
<arguments> <arguments>
</arguments> </arguments>
</buildCommand> </buildCommand>
@ -30,24 +35,14 @@
<arguments> <arguments>
</arguments> </arguments>
</buildCommand> </buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.hibernate.eclipse.console.hibernateBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec> </buildSpec>
<natures> <natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.springframework.ide.eclipse.core.springnature</nature> <nature>org.springframework.ide.eclipse.core.springnature</nature>
<nature>org.eclipse.jdt.core.javanature</nature> <nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature> <nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature> <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature> <nature>org.eclipse.wst.jsdt.core.jsNature</nature>
<nature>org.hibernate.eclipse.console.hibernateNature</nature>
</natures> </natures>
</projectDescription> </projectDescription>