Category: Kripton Persistence Library

Abubusoft Blog

Kripton release 7

It was quite a long time ago when I start to develop this release. The features were introduced: Core module Add support for java.time classes introduced with Java 8: now it is possible to persist field of type LocalDateTime, LocalDate etc, without define any custom TypeAdapter. Some bug fixing Orm module Add support for java.time…
Read more

Kripton: how to manage charset problems in Retrofit client

When you work with Retrofit and web services, you are probably (I hope so) working with UTF-8. Just remember that JSON RFC specifies to with it. In somecase I had to manage incorrect situation without change the backend behaviour (the server produce JSON is no UTF-8). Jackson library in its default behaviour throw an exception.…
Read more

Maven: how to put in a Java source the project version defined in pom.xml

Recently I decided to insert a message during Kripton Persistence Library initialization at run-time which display library version. To accomplish this task I need to include in the source code the maven project version contained in pom.xml. Is there a plugin for maven that can help me? The answer is YES! It’s templating-maven-plugin. So, I…
Read more

Kripton v.7 – work in progress

I’m not disappeared. I’m still here. I’m working on version 7 of Kripton Persistence Library. The main feature will be the support to SQLCipher, so you will be able to crypt your database! To bring this feature to Kripton, all generated data source will work with androidx.sqlite.db.SupportSQLiteDatabase. Kripton 7 have to say goodbye to android.sqlite.SQLiteDatabase.…
Read more

from StackOverflow: update some specific field of an entity

I take an old answer about the Room usage from stack overflow. The original post is: I am using android room persistence library for my new project. I want to update some field of the table. I have tried like in my Dao – But when I try to update using this method then it updates every…
Read more

Kripton ORM: how to generate content provider – example 2

Kripton ORM has a lot of features and simplifies a lot the developer life. If your application needs to expose its database with a content provider, in most case you have to write it. I have already written on this feature, so if you didn’t read it, I suggest you read this post too. Today I take…
Read more

Kripton ORM: how to store a HashSet in a column

Kripton ORM is the Kripton’s module to manage SQLite database. Store a HashSet in a column is quite easy. Let’s suppose we have a Java model mapped to the SQLite database in the following way: The associated DAO interface: And the database definition: Store a HashSet is simple as define it in the SchoolLunch. Kripton…
Read more

Kripton ORM: reusable generic base DAO interface

This post was inspired by the following question from StackOverflow: Reusable generic base class DAOs with Android Room. I reuse the original question and I try to approach the problem with Kripton. Room’s approach avoids using an ancestor interface for DAO interface to define for the SELECT operations. A parent DAO interface can be used only to define operationINSERT/UPDATE/DELETE but…
Read more

Kripton and SQLite: generate an SQLite based content provider

One of the key features of Kripton ORM is the capability to generate an SQLite content provider starting from a data source definition. More information about Content Provider can found here. Suppose we have in our application a music data source so defined: In this data source, there are Artist and Album entities. Every entity got its DAO interface.…
Read more

Kripton ORM: how to store byte arrays

Stackoverflow is always a good place to get ideas to write posts. Today I answer to this question. The original question is about using Room Library. But I want to change the question: how can I persist a byte array using Kripton ORM Library? With kripton, you can easily manage byte[] fields. Just to show…
Read more