Skip to content

Commit fcc0dee

Browse files
author
eugenp
committed
cleanup work
1 parent 732debf commit fcc0dee

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

‎src/main/java/org/rest/spring/persistence/jpa/PersistenceJPAConfig.java‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,16 @@ public class PersistenceJPAConfig{
3131
private String url;
3232

3333
@Value( "${hibernate.dialect}" )
34-
private String hibernateDialect;
34+
String hibernateDialect;
3535

3636
@Value( "${hibernate.show_sql}" )
37-
private boolean hibernateShowSql;
37+
boolean hibernateShowSql;
3838

3939
@Value( "${hibernate.hbm2ddl.auto}" )
40-
private String hibernateHbm2ddlAuto;
40+
String hibernateHbm2ddlAuto;
4141

4242
@Value( "${jpa.generateDdl}" )
43-
private boolean jpaGenerateDdl;
43+
boolean jpaGenerateDdl;
4444

4545
public PersistenceJPAConfig(){
4646
super();

‎src/main/java/org/rest/web/common/AbstractController.java‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,8 @@ protected final void createInternal( final T resource, final UriComponentsBuilde
9797
try{
9898
getService().create( resource );
9999
}
100-
// TODO: to remove or document some of these
101-
catch( final IllegalStateException ex ){
100+
// - these are disabled for now - the IllegalStateException may be reenabled at some point
101+
/*catch( final IllegalStateException ex ){
102102
logger.error( "IllegalStateException on create operation for: " + resource.getClass().getSimpleName() );
103103
logger.warn( "IllegalStateException on create operation for: " + resource.getClass().getSimpleName(), ex );
104104
throw new ResourceNotFoundException( ex );
@@ -107,7 +107,7 @@ protected final void createInternal( final T resource, final UriComponentsBuilde
107107
logger.error( "IllegalArgumentException on create operation for: " + resource.getClass().getSimpleName() );
108108
logger.warn( "IllegalArgumentException on create operation for: " + resource.getClass().getSimpleName(), ex );
109109
throw new ConflictException( ex );
110-
}
110+
}*/
111111
catch( final DataIntegrityViolationException ex ){ // on unique constraint
112112
logger.error( "DataIntegrityViolationException on create operation for: " + resource.getClass().getSimpleName() );
113113
logger.warn( "DataIntegrityViolationException on create operation for: " + resource.getClass().getSimpleName(), ex );
@@ -125,8 +125,7 @@ protected final void createInternal( final T resource, final UriComponentsBuilde
125125
}
126126

127127
// - note: mind the autoboxing and potential NPE when the resource has null id at this point (likely when working with DTOs)
128-
final ResourceCreatedEvent< T > resourceCreatedEvent = new ResourceCreatedEvent< T >( clazz, uriBuilder, response, resource.getId() );
129-
eventPublisher.publishEvent( resourceCreatedEvent );
128+
eventPublisher.publishEvent( new ResourceCreatedEvent< T >( clazz, uriBuilder, response, resource.getId() ) );
130129
}
131130

132131
// update

0 commit comments

Comments
 (0)