Eclipse JNoSQL is a framework whose has the goal to help Java developers to create Java EE applications with NoSQL
Eclipse JNoSQL is a Java framework that streamlines the integration of a Java application with the NoSQL database. It defines a set of APIs to interact with the NoSQL database and provides a standard implementation for most NoSQL databases.
This clearly helps to achieve very low coupling with the underlying NoSQL technologies used in applications.
If you want to contribute to the project, this is the Github repository:
https://github.com/JNOSQL
2. JNoSQL
#EclipseCon @JNoSQL @otavioJava @rafaDelNero
About the Speakers
Rafael Del Nero
• Creator of NoBugsProject
• #JavaChallenges
• Created the #JavaChallengers Series in Java World
• Java Developer, Equifax
• SouJava member
• Wrote the book “No Bugs, No Stress - Create a Life Changing
Software Without Destroying Your Life”
3. JNoSQL
#EclipseCon @JNoSQL @otavioJava @rafaDelNero
Otávio Santana
• Software engineer, Tomitribe
• Java Champion, SouJava JUG Leader
• Apache, Eclipse and OpenJDK Committer
• Expert Group member in many JSRs
• Representative at JCP EC for SouJava
About the Speakers
5. JNoSQL
#EclipseCon @JNoSQL @otavioJava @rafaDelNero
What defines NoSQL databases?
● No fixed data structure
● Not an ACID, but a BASE
● Five different types
◦ Key/Value
◦ Column Family
◦ Document
◦ Graph
◦ Multi-Model
6. JNoSQL
#EclipseCon @JNoSQL @otavioJava @rafaDelNero
DAO
Mapping
Communication
Document
Key
Column Graph
DIANA
ARTEMIS
JNoSQL
Data Tier
● Mapping API
● Communication API
● No lock-in
● Divide and conquer
JNoSQL
7. JNoSQL
#EclipseCon @JNoSQL @otavioJava @rafaDelNero
Annotated Entities
@Entity("god")
public class God {
@Column
private String name;
@Column
private long age;
@Column
private Set<String> powers;
● MappedSuperclass
● Entity
● Column
11. JNoSQL
#EclipseCon @JNoSQL @otavioJava @rafaDelNero
Diversity
@Entity("god")
public class God {
@Column
private String name;
@UDT("weapon")
@Column
private Weapon weapon;
}
interface GodRepository extends
CassandraRepository<God, String> {
@CQL("select * from God where name = ?")
List<God> findByName(String name);
}
12. JNoSQL
#EclipseCon @JNoSQL @otavioJava @rafaDelNero
Relational Application
DAO
API API API
Data Tier
Logic Tier
DAO
Logic Tier
Data Tier
JPA
JDBC
JPA
JDBC
JPA
JDBC
NoSQL Application
17. JNoSQL
#EclipseCon @JNoSQL @otavioJava @rafaDelNero
Clean Architecture
● The business matter in your code
● They do not need to know
● Business is OO, but the data…
● Boundaries
● Object-relational impedance
mismatch
22. JNoSQL
#EclipseCon @JNoSQL @otavioJava @rafaDelNero
Insert
public class MongoDBInsert {
public static void main(String[] args) {
Random random = new Random();
Long id = random.nextLong();
try (SeContainer container =
SeContainerInitializer.newInstance().initialize()) {
Person person = Person.builder().
withPhones(Arrays.asList("234", "432"))
.withName("Name")
.withId(id)
.withIgnore("Just Ignore").build();
DocumentTemplate documentTemplate =
container.select(DocumentTemplate.class).get();
Person saved = documentTemplate.insert(person);
System.out.println("Person saved" + saved);
}
}
}
23. JNoSQL
#EclipseCon @JNoSQL @otavioJava @rafaDelNero
Query
public class MongoDBQuery{
public static void main(String[] args) {
Random random = new Random();
Long id = 1L;
try (SeContainer container =
SeContainerInitializer.newInstance().initialize()) {
DocumentTemplate documentTemplate =
container.select(DocumentTemplate.class).get();
DocumentQuery query = select().from("Person")
.where("_id").eq(id).build();
Optional<Person> personOptional =
documentTemplate.singleResult(query);
System.out.println("Entity found: " + personOptional);
}
}
}
24. JNoSQL
#EclipseCon @JNoSQL @otavioJava @rafaDelNero
Otávio Santana Rafael Del Nero
Start using JNoSQL:
https://projects.eclipse.org/projects/technology.jnosql
Start contributing with JNoSQL
https://github.com/JNOSQL
Get the No Bugs No Stress ebook for free:
nobugsproject.com
Thank you!