Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expression Library priority changed. #339

Merged
merged 2 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 25 additions & 19 deletions README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ uroboroSQLは主にSQL中心の設計コンセプトを採用しています。J
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>ognl</groupId>
<artifactId>ognl</artifactId>
<version>3.1.23</version>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
<version>5.3.20</version>
</dependency>
```

Expand All @@ -41,24 +41,24 @@ uroboroSQLは主にSQL中心の設計コンセプトを採用しています。J
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
<version>5.3.20</version>
<groupId>ognl</groupId>
<artifactId>ognl</artifactId>
<version>3.1.23</version>
</dependency>
```

### for Gradle

```gradle
compile group: 'jp.co.future', name: 'uroborosql', version: '1.0.0-SNAPSHOT'
compile group: 'ognl', name: 'ognl', version: '3.1.23'
compile group: 'org.springframework', name: 'spring-expression', version: '5.3.20'
```

または

```gradle
compile group: 'jp.co.future', name: 'uroborosql', version: '1.0.0-SNAPSHOT'
compile group: 'org.springframework', name: 'spring-expression', version: '5.3.20'
compile group: 'ognl', name: 'ognl', version: '3.1.23'
```

## Documentation
Expand All @@ -67,7 +67,7 @@ compile group: 'org.springframework', name: 'spring-expression', version: '5.3.2

## Requirement

- Java 1.8 or later.
- Java 11 or later.

## Quick start

Expand Down Expand Up @@ -109,29 +109,33 @@ INTO
```

```java
SqlConfig config = UroboroSQL.builder("jdbc:h2:mem:test;DB_CLOSE_DELAY=-1", "sa", "").build();
SqlConfig config = UroboroSQL.builder("jdbc:h2:mem:test;DB_CLOSE_DELAY=-1", "sa", "")
.build();

try (SqlAgent agent = config.agent()) {
// SELECT
List<Map<String, Object>> departments = agent.query("department/select_department").param("dept_no", 1001).collect();
List<Map<String, Object>> departments = agent.query("department/select_department")
.param("dept_no", 1001)
.collect();

// INSERT
int count = agent.update("department/insert_department")
.param("dept_no", 1001)
.param("dept_name", "sales")
.count();
.param("dept_no", 1001)
.param("dept_name", "sales")
.count();
}
```

### DAO Interface

```java
SqlConfig config = UroboroSQL.builder("jdbc:h2:mem:test;DB_CLOSE_DELAY=-1", "sa", "").build();
SqlConfig config = UroboroSQL.builder("jdbc:h2:mem:test;DB_CLOSE_DELAY=-1", "sa", "")
.build();

try (SqlAgent agent = config.agent()) {
// select
Department dept =
agent.find(Department.class, 1001).orElse(null);
Department dept = agent.find(Department.class, 1001)
.orElse(null);

// insert
Department hrDept = new Department();
Expand Down Expand Up @@ -168,12 +172,14 @@ try (SqlAgent agent = config.agent()) {

- CLI
- <https://github.com/future-architect/uroboroSQL-formatter>
- VSCode Plugin
- <https://github.com/future-architect/vscode-uroborosql-fmt>
- Eclipse Plugin
- <https://github.com/future-architect/eclipse-uroborosql-formatter>
- Sublime Text 3 Plugin
- <https://github.com/future-architect/Sublime-uroboroSQL-formatter>
- IntelliJ IDEA Platform Plugin
- <https://github.com/future-architect/idea-uroborosql-formatter>
- Eclipse Plugin
- <https://github.com/future-architect/eclipse-uroborosql-formatter>

## License

Expand Down
44 changes: 25 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ for Japanese, see [README.ja.md](https://github.com/future-architect/uroborosql/
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>ognl</groupId>
<artifactId>ognl</artifactId>
<version>3.1.23</version>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
<version>5.3.20</version>
</dependency>
```

Expand All @@ -43,24 +43,24 @@ or
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
<version>5.3.20</version>
<groupId>ognl</groupId>
<artifactId>ognl</artifactId>
<version>3.1.23</version>
</dependency>
```

### for Gradle

```gradle
compile group: 'jp.co.future', name: 'uroborosql', version: '1.0.0-SNAPSHOT'
compile group: 'ognl', name: 'ognl', version: '3.1.23'
compile group: 'org.springframework', name: 'spring-expression', version: '5.3.20'
```

or

```gradle
compile group: 'jp.co.future', name: 'uroborosql', version: '1.0.0-SNAPSHOT'
compile group: 'org.springframework', name: 'spring-expression', version: '5.3.20'
compile group: 'ognl', name: 'ognl', version: '3.1.23'
```

## Documentation
Expand All @@ -69,7 +69,7 @@ compile group: 'org.springframework', name: 'spring-expression', version: '5.3.2

## Requirement

- Java 1.8 or later.
- Java 11 or later.

## Quick start

Expand Down Expand Up @@ -111,29 +111,33 @@ INTO
```

```java
SqlConfig config = UroboroSQL.builder("jdbc:h2:mem:test;DB_CLOSE_DELAY=-1", "sa", "").build();
SqlConfig config = UroboroSQL.builder("jdbc:h2:mem:test;DB_CLOSE_DELAY=-1", "sa", "")
.build();

try (SqlAgent agent = config.agent()) {
// SELECT
List<Map<String, Object>> departments = agent.query("department/select_department").param("dept_no", 1001).collect();
List<Map<String, Object>> departments = agent.query("department/select_department")
.param("dept_no", 1001)
.collect();

// INSERT
int count = agent.update("department/insert_department")
.param("dept_no", 1001)
.param("dept_name", "sales")
.count();
.param("dept_no", 1001)
.param("dept_name", "sales")
.count();
}
```

### DAO Interface

```java
SqlConfig config = UroboroSQL.builder("jdbc:h2:mem:test;DB_CLOSE_DELAY=-1", "sa", "").build();
SqlConfig config = UroboroSQL.builder("jdbc:h2:mem:test;DB_CLOSE_DELAY=-1", "sa", "")
.build();

try (SqlAgent agent = config.agent()) {
// select
Department dept =
agent.find(Department.class, 1001).orElse(null);
Department dept = agent.find(Department.class, 1001)
.orElse(null);

// insert
Department hrDept = new Department();
Expand Down Expand Up @@ -170,12 +174,14 @@ We also prepare a SQL formatter useful for development.

- CLI
- <https://github.com/future-architect/uroboroSQL-formatter>
- VSCode Plugin
- <https://github.com/future-architect/vscode-uroborosql-fmt>
- Eclipse Plugin
- <https://github.com/future-architect/eclipse-uroborosql-formatter>
- Sublime Text 3 Plugin
- <https://github.com/future-architect/Sublime-uroboroSQL-formatter>
- IntelliJ IDEA Platform Plugin
- <https://github.com/future-architect/idea-uroborosql-formatter>
- Eclipse Plugin
- <https://github.com/future-architect/eclipse-uroborosql-formatter>

## License

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,7 @@ public Path getSqlPath(final String sqlName) {
*
* @param path リソースのパス
* @return リソースのURL. リソースが存在しない場合は<code>null</code>
* @throws IOException リソースの取得に失敗した場合
*/
protected URL getResource(final Path path) throws IOException {
var resources = Collections.list(classLoader.getResources(path.toString().replace('\\', '/')));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
jp.co.future.uroborosql.expr.ognl.OgnlExpressionParserFactory
jp.co.future.uroborosql.expr.spel.SpelExpressionParserFactory
jp.co.future.uroborosql.expr.spel.SpelExpressionParserFactory
jp.co.future.uroborosql.expr.ognl.OgnlExpressionParserFactory
Loading