Refactoring domain and config classes
This commit is contained in:
parent
63dcae6423
commit
ce412e718e
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue