Skip to content

Commit ea09577

Browse files
committed
Update
1 parent 6c359ab commit ea09577

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

source/documentation/orm.html.md.erb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ In the realm of O/R mapper, the hallmark feature lies in its ability to effortle
140140

141141
[This test code](https://github.com/scalikejdbc/scalikejdbc/tree/master/scalikejdbc-orm/src/test/scala/basic_test/accounts) provides invaluable insights for learning. If you're unable to find specific examples here, referring to the code will be greatly helpful.
142142

143+
<hr/>
143144
#### hasOne
144145

145146
The `hasOne` relationship signifies that table A is referenced from table B via table A's primary key. Your code aims to include table B's data within the entity of table A. In the following example, the `Member` entity (representing table A) includes a `name` property, which can be resolved using the `member_id` column within the `Name` entity (representing table B).
@@ -198,6 +199,7 @@ object Member extends CRUDMapper[Member] {
198199

199200
This `#byDefault` method is available for all other association APIs.
200201

202+
<hr/>
201203
#### belongsTo
202204

203205
The `belongsTo` relationship indicates that table B is referenced from table A via table B's primary key. Your code aims to incorporate table B's data into the entity of table A. In the following example, the `Member` entity (representing table A) includes a `company` property, which can be resolved using the `company_id` column within the entity. From another perspective, the `Company` entity (representing table B) does not contain any information about `Member` (table A).
@@ -243,6 +245,7 @@ val member: Option[Member] =
243245

244246
As mentioned above, once you add `byDefault` call to the `belongsTo` code line, you can omit `.joins(Member.company)` in the code.
245247

248+
<hr/>
246249
#### hasMany
247250

248251
The `hasMany` relationship denotes that table A is referenced from table B via table A's primary key. Your code seeks to include multiple rows from table B into the entity of table A. In the following example, the `Company` entity (representing table A) contains a `members` property, which can be resolved using the `company_id` column on the `Member` entity side (representing table B).
@@ -336,11 +339,12 @@ Here is a code snippet demonstrating how to perform join queries:
336339

337340
```scala
338341
val alice: Option[Member] =
339-
Member.joins(Member.skills).findById(123)
342+
Member.joins(Member.skills).findById(123)
340343
```
341344

342345
The `alice.map(_.skills)` should be a list of `Skill` entities if some skills are saved in the "member_skill" table.
343346

347+
<hr/>
344348
#### includes (Eager Loading)
345349

346350
When enabling eager loading via the `includes` API, it's necessary to define both the `belongsTo` etc. and `includes` within the same association claim.
@@ -389,4 +393,6 @@ Please note that eager loading of more deeply nested entities is not currently s
389393

390394
While it could be feasible with a dynamic programming language like Ruby, achieving the same functionality with a strictly typed language like Scala is quite challenging. At present, we don't have any plans to enhance this feature unless the Scala language provides a revolutionary hack for us to leverage.
391395

396+
<hr/>
397+
392398
For more examples and hands-on learning, please refer to [this example working code](https://github.com/scalikejdbc/scalikejdbc/tree/master/scalikejdbc-orm/src/test/scala/basic_test/accounts). If you have any questions or feature requests, don't hesitate to submit them on GitHub!

source/index.html.md.erb

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
# ScalikeJDBC
22

33
<hr/>
4-
## Just write SQL and get things done
4+
## Just Write SQL And Get Things Done 💪
55
<hr/>
66

7-
![Logo](images/logo.png)
8-
97
This library seamlessly wraps JDBC APIs, offering intuitive and highly flexible functionalities. With QueryDSL, your code becomes inherently type-safe and reusable.
108

119
ScalikeJDBC is not just practical; it's production-ready. Utilize this library confidently in your real-world projects.
1210

13-
### Working on the JDBC layer
11+
![Logo](images/logo.png)
12+
13+
<hr/>
14+
### Working on JDBC Layer
1415

1516
Whether you prefer it or not, JDBC stands as a steadfast standard interface. Given its widespread support across most RDBMS, accessing databases remains consistent. We adhere to this standard rigorously, ensuring each release passes through comprehensive unit tests across various RDBMS platforms:
1617

@@ -21,11 +22,12 @@ Whether you prefer it or not, JDBC stands as a steadfast standard interface. Giv
2122

2223
We firmly believe that ScalikeJDBC seamlessly integrates with a variety of RDBMS, including Oracle, SQL Server, and others. Its robust design ensures compatibility and reliability across different database platforms.
2324

24-
### Amazon Redshift, Facebook Presto also supports JDBC
25+
#### Amazon Redshift, Facebook Presto also supports JDBC
2526

2627
If you can access a datastore via the JDBC interface, you can also seamlessly access it through ScalikeJDBC. For instance, [Amazon Redshift](https://docs.aws.amazon.com/redshift/latest/dg/c_redshift-postgres-jdbc.html) and [Facebook Presto](https://prestodb.io/docs/current/installation/jdbc.html) have added support for the JDBC interface, enabling easy integration with ScalikeJDBC.
2728

28-
### Few dependencies
29+
<hr/>
30+
### Less Dependencies
2931

3032
The core of ScalikeJDBC boasts minimal dependencies, sparing you from the woes of dependency hell. Enjoy a streamlined development experience without unnecessary complications.
3133

@@ -35,7 +37,7 @@ The core of ScalikeJDBC boasts minimal dependencies, sparing you from the woes o
3537

3638
Certainly, you have the flexibility to utilize c3p0 or other connection pool libraries instead of commons-dbcp with ScalikeJDBC. While ScalikeJDBC doesn't offer a default ConnectionPool implementation for these alternatives, you have the freedom to integrate them seamlessly according to your project requirements.
3739

38-
### Non-blocking?
40+
### No Non-Blocking?
3941

4042
While JDBC drivers inherently block on socket IO, making them potentially unsuitable for async event-driven architectures, it's worth noting that most real-world applications currently don't require such architecture. JDBC remains a crucial infrastructure for JVM-based apps.
4143

source/layouts/layout.erb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
<p><%= link_to 'One-to-x API', '/documentation/one-to-x.html' %></p>
5252
<p><%= link_to 'Auto Macros', '/documentation/auto-macros.html' %></p>
5353
<p><%= link_to 'Logging / Query Inspector', '/documentation/query-inspector.html' %></p>
54+
<p><%= link_to 'O/R Mapper', '/documentation/orm.html' %></p>
5455
<p><%= link_to 'Reverse Engineering', '/documentation/reverse-engineering.html' %></p>
5556
<p><%= link_to 'Testing', '/documentation/testing.html' %></p>
5657
<p><%= link_to 'Play Framework', '/documentation/playframework-support.html' %></p>

0 commit comments

Comments
 (0)