Skip to content

Commit

Permalink
feat: create documentation to sql
Browse files Browse the repository at this point in the history
Signed-off-by: Otavio Santana <otaviopolianasantana@gmail.com>
  • Loading branch information
otaviojava committed Jan 22, 2024
1 parent 52ddc9d commit d4a88bf
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
package org.eclipse.jnosql.databases.oracle.mapping;public interface OracleRepository {
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,46 @@
*/
package org.eclipse.jnosql.databases.oracle.mapping;


/**
* The {@code SQL} annotation is a custom annotation used to associate SQL query strings
* with methods or elements in your code.
* <p>
* When applied to a method, field, or other element, this annotation provides a convenient
* way to specify an SQL query that should be associated with that element.
* </p>
* <p>
* For example, you can use this annotation to specify a SQL query for a method as follows:
* </p>
* <pre>
* {@code
* @SQL("SELECT * FROM users WHERE status = 'active'")
* public void getUserData() {
* // Method implementation
* }
* }
* </pre>
* <p>
* In the context of an {@code OracleRepository}, you can use the {@code @SQL} annotation
* to define custom SQL queries for repository methods. Here's an example:
* </p>
* <pre>
* {@code
* public interface UserRepository extends OracleRepository<User, Long> {
* // Find all active users using a custom SQL query
* @SQL("SELECT * FROM users WHERE status = 'active'")
* List<User> findActiveUsers();
* }
* }
* </pre>
* <p>
* In this example, the {@code @SQL} annotation is used to define a custom SQL query for the
* {@code findActiveUsers} method in an {@code OracleRepository} interface, allowing you
* to execute the specified SQL query when calling the repository method.
* </p>
*/
public @interface SQL {


String value();
}

0 comments on commit d4a88bf

Please sign in to comment.