Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [data-dev] Jakarta Data

Hey Gabriel, sorry for the delayed response.

Ideally, each entity has its repository, meaning that if you have a Car entity, you would typically have a CarRepository. However, Jakarta Data does not enforce this structure. You are free to design repositories that best suit your domain. For example, instead of CarRepository, you might name it GarageRepository if it better represents the concept of managing a collection of cars. The specification does not impose naming restrictions.

Additionally, an entity is not limited to a single repository interface. You can define multiple repositories for the same entity, each serving different purposes. For instance:

  • A CarRepository handling standard CRUD operations.
  • A CarSearchRepository optimized for querying cars with specific filters.

Jakarta Data also allows repositories to support multiple data sources, meaning the same repository can work with both SQL and NoSQL databases:

  • For SQL databases, you use Jakarta Persistence annotations.
  • For NoSQL databases, you use Jakarta NoSQL annotations.

For more details and examples, you might find this article helpful:
Persisting Data with Jakarta EE and Jakarta Data


On Thu, Feb 20, 2025 at 5:09 AM Gabriel Cunha via data-dev <data-dev@xxxxxxxxxxx> wrote:
I dont mean entities relationship, I mean how many repositories you have for different entities.
One repo for one entity, one repo for multiple entitie, without being forced to extend some kind of CrudRepository that forces to have an entire repository all about a single entity.

That was confusing, my bad! And thanks for answering!

Em qui., 20 de fev. de 2025 às 02:04, hantsy bai <hantsy@xxxxxxxxx> escreveu:
Jakarta Data does not help you handle entity relations; the Jakarta Persistence cascade options do not work in Jakarta Data.

---

Regards,

Hantsy Bai

Self-employed consultant, fullstack developer, agile coach, freelancer/remote worker

GitHub: https://github.com/hantsy

Twitter: https://twitter.com/@hantsy

Medium: https://medium.com/@hantsy


On Thu, Feb 20, 2025 at 11:31 AM Gabriel Cunha via data-dev <data-dev@xxxxxxxxxxx> wrote:
Hey, guys!

I'm preparing a talk about Jakarta Data. The main goal with the talk is to rethink Data Repositories using Jakarta Data and Quarkus.

I want to cover up to 5 topics on how Jakarta Data helps us to implement the persistence layer in a different way. Here are a few topics I wrote down while reading and watching other presentations:

1 - Type safety
2 - Repository/Entity relationship: One to one, one to many, many to many
3 - Debbuging and understanding
4 - Simpler queries
5 - Flexibility and productivity

Any thoughts on these 5, specifically if they are accurate according to Jakarta Data goals or if any of these could be replaced by a different topic?

If there's a different mailing list or forum where I should send this question, just let me know!

Thanks in advance!
_______________________________________________
data-dev mailing list
data-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://accounts.eclipse.org
_______________________________________________
data-dev mailing list
data-dev@xxxxxxxxxxx
To unsubscribe from this list, visit https://accounts.eclipse.org


--

Thanks a lot,

Twitter | Linkedin | Youtube


Back to the top