File tree Expand file tree Collapse file tree 4 files changed +5
-11
lines changed
main/java/org/baeldung/spring/persistence
test/java/org/baeldung/spring/persistence/service Expand file tree Collapse file tree 4 files changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -40,11 +40,7 @@ public LocalContainerEntityManagerFactoryBean entityManagerFactoryBean() {
4040 factoryBean .setDataSource (restDataSource ());
4141 factoryBean .setPackagesToScan (new String [] { "org.baeldung.spring.persistence.model" });
4242
43- final JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter () {
44- {
45- // JPA properties ...
46- }
47- };
43+ final JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter ();
4844 factoryBean .setJpaVendorAdapter (vendorAdapter );
4945 factoryBean .setJpaProperties (additionalProperties ());
5046
Original file line number Diff line number Diff line change @@ -40,9 +40,9 @@ public void create(final Foo entity) {
4040 }
4141
4242 @ Override
43- public void update (final Foo entity ) {
43+ public Foo update (final Foo entity ) {
4444 Preconditions .checkNotNull (entity );
45- entityManager .merge (entity );
45+ return entityManager .merge (entity );
4646 }
4747
4848 @ Override
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ public interface IFooDao {
1212
1313 void create (Foo entity );
1414
15- void update (Foo entity );
15+ Foo update (Foo entity );
1616
1717 void delete (Foo entity );
1818
Original file line number Diff line number Diff line change 44
55import org .baeldung .spring .persistence .config .PersistenceConfig ;
66import org .baeldung .spring .persistence .model .Foo ;
7- import org .junit .Ignore ;
87import org .junit .Test ;
98import org .junit .runner .RunWith ;
109import org .springframework .beans .factory .annotation .Autowired ;
@@ -51,9 +50,8 @@ public final void whenSameEntityIsCreatedTwice_thenDataException() {
5150 }
5251
5352 @ Test
54- @ Ignore
5553 public final void temp_whenInvalidEntityIsCreated_thenDataException () {
56- service .create (new Foo (randomAlphabetic ( 2048 ) ));
54+ service .create (new Foo ());
5755 }
5856
5957}
You can’t perform that action at this time.
0 commit comments