Refactoring domain and config classes

This commit is contained in:
Sasa M 2020-04-02 18:53:23 +02:00 committed by Sasa M
parent 63dcae6423
commit ce412e718e
3 changed files with 3 additions and 13 deletions

View File

@ -38,16 +38,6 @@ public class AppConfig {
return new ModelMapper(); return new ModelMapper();
} }
/* @Bean
public ObjectMapper objectMapper() {
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
mapper.configure(MapperFeature.DEFAULT_VIEW_INCLUSION, true);
return mapper;
}
*/
@Bean(name = "emf") @Bean(name = "emf")
public LocalContainerEntityManagerFactoryBean entityManagerFactory() { public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
@ -58,7 +48,7 @@ public class AppConfig {
factory.setJpaVendorAdapter(vendorAdapter); factory.setJpaVendorAdapter(vendorAdapter);
factory.setPackagesToScan("com.baeldung.employee"); factory.setPackagesToScan("com.baeldung.employee");
factory.setDataSource(h2DataSource()); factory.setDataSource(h2DataSource());
// factory.setJpaProperties(jpaProperties());
return factory; return factory;
} }

View File

@ -4,6 +4,6 @@ import org.springframework.data.jpa.repository.JpaRepository;
import com.baeldung.employee.domain.Employee; import com.baeldung.employee.domain.Employee;
public interface EmployeeRepo extends JpaRepository<Employee, Long> { public interface EmployeeRepo extends JpaRepository<Employee, Integer> {
} }

View File

@ -7,7 +7,7 @@ import javax.persistence.Id;
import javax.persistence.Table; import javax.persistence.Table;
@Entity @Entity
@Table(name = "EMPLOYEE") @Table
public class Employee { public class Employee {
@Id @Id