Unique name and type

Daobab Column is a base interface, represented DataBase column, which is a part of table.

The name and context of this library depends of column name and type.

Each column, identified by name and type has own interface created.

Interface may be inherited by every Entity.

This construction recreates relations between tables

Interface collects informations as follows:

  1. DataBase column name
    to communicate with database
  2. Java field name
    A key into Entity map
  3. Object Type
    Class Type for column values
  4. Relation to Entity
    Which Entity contains the column.
    This information is generic, provided through Class type during Entity initialisation.

public interface Name<E extends EntityMap, F> extends EntityRelationMap<E> {

default F getName() {
return getColumnParam("Name");

default E setName(F val) {
"Name", val);
return (E) this;

default Column<E, F, Name> colName() {
return new Column<E, F, Name>() {

public String getColumnName() {
return "NAME";

public String getFieldName() {
return "Name";

public E getInstance(){
return getEntity();

public Class getFieldClass() {
return String.class;

public F getValue(Name entity) {
if (entity == null) throw new AttemptToReadFromNullEntityException(getEntityClass(), "Name");
return (F) entity.getName();

public void setValue(Name entity, F param) {
if (entity == null) throw new AttemptToWriteIntoNullEntityException(getEntityClass(), "Name");

public int hashCode() {
return toString().hashCode();

public String toString(){
return getEntityName()+"."+getFieldName();

public boolean equals(Object obj) {
if (this == obj)return true;
if (obj == null)return false;
if (getClass() != obj.getClass())return false;
                Column other = (Column) obj;
return Objects.equals(hashCode(), other.hashCode());



© Copyright 2018-2023 Elephant Software Klaudiusz Wojtkowiak