Skip to content

Commit c29097b

Browse files
committed
DDDD
1 parent 82b6656 commit c29097b

File tree

4 files changed

+31
-55
lines changed

4 files changed

+31
-55
lines changed

content/docs/why/_index.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,8 @@ seo:
2020
noindex: false # false (default) or true
2121
---
2222

23-
SQL Compomnents is a compile time **ORM** that build native JDBC Code out of Relationsal database instance. It also provides type safe SQL Builder for safer, secure and productive persdiatnce development.
23+
SQL Compomnents is a compile time tool that build native JDBC Code out of Relationsal database instance. It also provides type safe SQL Builder for safer, secure and productive persdiatnce development. Before we see how it is diffrent from others , We should understand what all we should do when we interact with relational databases from java.
24+
25+
Connection Management
26+
Model
27+
Data Access Object

content/docs/why/jpa.md

Lines changed: 10 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -15,54 +15,20 @@ seo:
1515
---
1616

1717

18-
## Comparison with JPA (Java Persistence API)
18+
JPA will abstract all the connection management and also Dao complexity from the user. For E.g while we use Spring JPA , We should will have below item
1919

20-
### 1. Query Handling
21-
- **JPA**: In JPA, the framework abstracts away the SQL queries by using JPQL (Java Persistence Query Language) or a Criteria API. This simplifies the developer's work by automating the generation of SQL queries, reducing the amount of boilerplate code.
22-
- **mysqlComponents**: In contrast, `mysqlComponents` directly uses Java's native libraries for query execution. Developers have full control over the SQL queries, which provides flexibility for complex or performance-critical queries.
20+
All you will write is
2321

24-
### 2. Learning Curve
25-
- **JPA**: With its abstraction, JPA has a steeper learning curve due to the complexity of the framework, annotations, entity management, and the need to understand the JPA lifecycle.
26-
- **mysqlComponents**: Since it relies on Java’s native libraries and requires developers to write SQL directly, `mysqlComponents` is straightforward for those already familiar with SQL, resulting in a flatter learning curve.
22+
Model Classes
23+
Data Access Objects ( Only Interface )
2724

28-
### 3. Control Over SQL
29-
- **JPA**: JPA generates SQL queries based on object mappings, which may not always be optimal or well-suited for complex queries. Custom queries are possible, but using native SQL within JPA breaks its abstraction and might complicate code maintenance.
30-
- **mysqlComponents**: Developers have complete control over the SQL syntax and logic, which can lead to more optimized and tailored queries.
3125

32-
---
33-
34-
## Advantages and Disadvantages of JPA
35-
36-
### Advantages of JPA:
37-
1. **Abstraction**: Simplifies interaction with databases by abstracting the SQL layer, allowing developers to focus on the business logic.
38-
2. **Entity Management**: Automates the persistence lifecycle, including transactions, caching, and object-relational mapping (ORM), leading to less boilerplate code.
39-
3. **Cross-Database Support**: JPA is database-agnostic, making it easier to switch databases without rewriting queries.
40-
41-
### Disadvantages of JPA:
42-
1. **Performance Overhead**: The abstraction adds a performance overhead, especially for complex queries. The generated SQL may not always be optimized.
43-
2. **Learning Complexity**: JPA requires a good understanding of ORM concepts, annotations, and persistence lifecycle, which increases the learning curve.
44-
3. **Lack of Flexibility**: Complex queries are harder to write and manage within the JPA framework. Sometimes, developers need to use native SQL, negating the benefit of the abstraction.
45-
46-
---
47-
48-
## Advantages and Disadvantages of `mysqlComponents`
49-
50-
### Advantages of `mysqlComponents`:
51-
1. **Full SQL Control**: Developers write and execute native SQL queries directly, allowing for better performance and optimization for specific use cases.
52-
2. **Simplicity**: There’s no need to learn an ORM or abstraction layer, making the library easier for developers familiar with SQL and Java.
53-
3. **Lightweight**: No additional ORM overhead means better performance, especially for applications with complex query requirements.
54-
55-
### Disadvantages of `mysqlComponents`:
56-
1. **Manual Query Management**: Since there’s no abstraction, developers must manage SQL queries, transactions, and entity mapping manually, increasing the potential for errors and requiring more effort.
57-
2. **Database-Specific**: SQL queries are specific to the database being used, which can limit cross-database portability unless developers account for different SQL dialects.
58-
3. **No Caching**: Unlike JPA, which provides caching mechanisms, `mysqlComponents` doesn’t handle caching natively, so developers must implement caching on their own if needed.
59-
60-
---
61-
62-
## Conclusion
63-
64-
`mysqlComponents` is a robust alternative for developers who prefer fine-grained control over their SQL queries. While JPA is ideal for projects where abstraction and ease of use are critical, `mysqlComponents` excels in performance-sensitive applications where developers require full control over SQL execution.
26+
```java
27+
```
6528

66-
Each framework has its strengths and weaknesses, and choosing between JPA and `mysqlComponents` depends on the specific needs of your application, such as performance, complexity, and developer expertise.
29+
SQL Components will do the same functionality with better typesafe API.
6730

31+
```java
32+
```
6833

34+
where Model, Data Access Objects Interfaces will be automatically generated.

content/docs/why/sql-builders.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,21 @@ seo:
1414
noindex: false # false (default) or true
1515
---
1616

17+
SQL Builders will abstract all the connectiona management complexity from the user. For E.g while we use Spring JDBC Client, We should will have below item
1718

18-
Spring JDBC Template
19+
All you will write is
20+
21+
Model Classes
22+
Data Access Objects ( Using JDBC Clients )
23+
RowMappers
24+
25+
```java
26+
```
27+
28+
SQL Components will do the same functionality with better typesafe API.
29+
30+
```java
31+
```
32+
33+
where Model, Data Access Objects and RowMappers will be automatically generated.
1934

hugo_stats.json

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
"h1",
2121
"h2",
2222
"h3",
23-
"h4",
2423
"h5",
2524
"head",
2625
"header",
@@ -266,18 +265,12 @@
266265
"comparison-with-jooq-framework",
267266
"comparison-with-jpa-java-persistence-api",
268267
"conclusion",
269-
"custom-code-generation",
270268
"disadvantages-of-jooq",
271269
"disadvantages-of-jpa",
272270
"disadvantages-of-mysqlcomponents",
273271
"disadvantages-of-sqlcomponents",
274272
"doks-docs-nav",
275-
"expand-the-frameworks-compatibility-to-include-oracle-and-sql-server-enabling-seamless-integration-with-a-broader-range-of-database-systems",
276273
"further-reading",
277-
"geo-location-datatypes-support",
278-
"implement-custom-code-generation-features-to-automate-and-standardize-repetitive-coding-tasks-enhancing-productivity-and-reducing-manual-errors",
279-
"integrate-transaction-support-to-ensure-data-consistency-and-reliability-during-complex-operations-by-managing-and-safeguarding-multiple-changes-within-a-single-transaction",
280-
"introduce-support-for-geo-location-data-types-allowing-the-handling-and-processing-of-spatial-data-directly-within-the-framework",
281274
"key-differences",
282275
"offcanvasNavMain",
283276
"offcanvasNavSection",
@@ -290,9 +283,7 @@
290283
"searchToggleDesktop",
291284
"searchToggleMobile",
292285
"socialMenu",
293-
"support-for-oracle-and-sql-server",
294286
"toc",
295-
"transaction-support",
296287
"what-is-jooq"
297288
]
298289
}

0 commit comments

Comments
 (0)