davidmoten / davidmoten/rxjava-jdbc

Will you consider taking the Dao/Model pattern of JDBI and SpringData?

Open
#19 37 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
801
Forks
114
Avg merge
1m
Merged PRs (30d)
3

Description

Will you please also consider taking these code pattern from JDBI or SpringData?
http://jdbi.org/

`````` java
public interface MyDAO
{
@SqlUpdate("create table something (id int primary key, name varchar(100))")
void createSomethingTable();

@SqlUpdate("insert into something (id, name) values (:id, :name)")
void insert(@Bind("id") int id, @Bind("name") String name);

@SqlQuery("select name from something where id = :id")
String findNameById(@Bind("id") int id);

/**
* close with no args is used to close the connection
*/
void close();
}```

OR Model+Repository pattern from springdata:
https://github.com/spring-projects/spring-data-book/tree/master/mongodb

```java
package com.oreilly.springdata.mongodb.core;
import org.springframework.data.repository.Repository;

/**
* Repository interface to access {@link Customer}s.
*
* @author Oliver Gierke
*/
public interface CustomerRepository extends Repository {

/**
* Returns the customer with the given identifier.
*
* @param id
* @return
*/
Customer findOne(Long id);

/**
* Saves the given {@link Customer}. #
*
* @param customer
* @return
*/
Customer save(Customer customer);

/**
* Returns the {@link Customer} with the given {@link EmailAddress}.
*
* @param string
* @return
*/
Customer findByEmailAddress(EmailAddress emailAddress);
}
``````

**However have OPTIONS to handle the commonly used pattern in Reactive or Sync model??**

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.