Skip to content

Conversation

javier-godoy
Copy link
Member

Experimental implementation that leverages JpaSpecificationExecutor in order to support spring-data repositories from commons-backend services.

The implementation depends on commons-data-impl in order to reutilize ConstraintTransformerJpaImpl

Example:

public interface MyEntityDao 
	extends CrudRepository<MyEntity, Long>, 
	JpaSpecificationExecutor<MyEntity> { }

public class MyEntityServiceImpl
	extends JpaCrudService<MyEntity, Long>
	implements MyEntityService {

	@Autowired
	@Getter
	private MyEntityDao crudRepository;

	@Autowired
	@Getter
	private MyEntityDao executor;

	@Override
	protected Long getId(MyEntity entity) {
		return entity.getId();
	}
	
}

@javier-godoy javier-godoy requested a review from mlopezFC April 13, 2022 01:16
@javier-godoy javier-godoy changed the title Spring data jpa Spring data JPA support Apr 13, 2022
Copy link
Member

@mlopezFC mlopezFC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it would be a good idea to rename the new module to commons-business-spring-impl
What do you think?

Copy link
Member

@mlopezFC mlopezFC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mlopezFC mlopezFC merged commit 0ee4d7b into master Apr 18, 2022
@mlopezFC mlopezFC deleted the spring-data-jpa branch April 18, 2022 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants