<commit_before># BananaRama
[![alt text](https://travis-ci.org/cr0wbar/Bananarama.svg?branch=master "Build Status")](https://travis-ci.org/cr0wbar/Bananarama)
### Overview
BananaRama provides a simple and extensible CRUD framework to access the persistency layer in a modular and scalable way. It aims to provide simple APIs to query entities without the client really knowing where those entities are stored.

This is an example of how the client code looks when entities are managed using BananaRama.

```java
public class Crud {
    
    public void test() {

	BananaRama bananarama = new BananaRama();

        //Create entry on persistency layer
        Entry entry = new Entry("testKey","testVal");
        bananarama.create(Entry.class).from(Stream.of(entry));
	
        //Read entry
        Entry entry = bananarama.read(Entry.class).all().findAny().get();        

        //Update for previous entry
        Entry entryUpdated = new Entry("testKey","testValUpdated");       
        bananarama.update(Entry.class).from(Stream.of(entryUpdated));
        
        //Delete entry
        bananarama.delete(Entry.class).from(Stream.of(entryUpdated));
        
    }
}
```
### Built-In persistency layer support
BananaRama natively supports the following frameworks/persistency layers

* [JDBC] (#jdbc) - fast POJOs to SQL and viceversa.
* [JPA](#jpa) - Manage JPA entities with BananaRama.
* [CQEngine](#cqengine) - Integrated support for CQEngine indexed collection on top of other persistency layers or standalone.
* [Magic](#magic-dto-to-object-and-viceversa) - Easy to use implementation of the DTO pattern.
## Simplest Example
Integration of entities in BananaRama is done in two steps.
First we need to create a class which implements the  `Adapter` interface. This will be the class that will actually manage the entities, either by accessing the persistency layer or calling other adapters. 

```
public class NoOpAdapter implements Adapter<Object>{
    //A really simple adapter which does nothing :)
    @Override
    public <T> CreateOperation<T> create(Class<T> clazz) {
      return new NoOpCreateOperation();
    }
    
    @Override
    public <T> ReadOperation<T> read(Class<T> clazz) {
        return new NoOpReadOperation<>();
    }
    <commit_msg>Added language syntax highlight<commit_after># BananaRama
[![alt text](https://travis-ci.org/cr0wbar/Bananarama.svg?branch=master "Build Status")](https://travis-ci.org/cr0wbar/Bananarama)
### Overview
BananaRama provides a simple and extensible CRUD framework to access the persistency layer in a modular and scalable way. It aims to provide simple APIs to query entities without the client really knowing where those entities are stored.

This is an example of how the client code looks when entities are managed using BananaRama.

```java
public class Crud {
    
    public void test() {

	BananaRama bananarama = new BananaRama();

        //Create entry on persistency layer
        Entry entry = new Entry("testKey","testVal");
        bananarama.create(Entry.class).from(Stream.of(entry));
	
        //Read entry
        Entry entry = bananarama.read(Entry.class).all().findAny().get();        

        //Update for previous entry
        Entry entryUpdated = new Entry("testKey","testValUpdated");       
        bananarama.update(Entry.class).from(Stream.of(entryUpdated));
        
        //Delete entry
        bananarama.delete(Entry.class).from(Stream.of(entryUpdated));
        
    }
}
```
### Built-In persistency layer support
BananaRama natively supports the following frameworks/persistency layers

* [JDBC] (#jdbc) - fast POJOs to SQL and viceversa.
* [JPA](#jpa) - Manage JPA entities with BananaRama.
* [CQEngine](#cqengine) - Integrated support for CQEngine indexed collection on top of other persistency layers or standalone.
* [Magic](#magic-dto-to-object-and-viceversa) - Easy to use implementation of the DTO pattern.
## Simplest Example
Integration of entities in BananaRama is done in two steps.
First we need to create a class which implements the  `Adapter` interface. This will be the class that will actually manage the entities, either by accessing the persistency layer or calling other adapters. 

```java
public class NoOpAdapter implements Adapter<Object>{
    //A really simple adapter which does nothing :)
    @Override
    public <T> CreateOperation<T> create(Class<T> clazz) {
      return new NoOpCreateOperation();
    }
    
    @Override
    public <T> ReadOperation<T> read(Class<T> clazz) {
        return new NoOpReadOperation<>();
    }
    
{'fraction_non_alphanumeric': 0.09544658493870403, 'fraction_numerical': 0.0008756567425569177, 'mean_word_length': 3.559880239520958, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5638190', 'n_tokens_mistral': 1337, 'n_tokens_neox': 1268, 'n_words': 450}