Class SimpleStringLookupDao<POJO extends SimpleStringLookupPojo<POJO>>

java.lang.Object
tenapull.data.persistence.Dao<POJO>
tenapull.data.persistence.SimpleStringLookupDao<POJO>
Type Parameters:
POJO - the pojo type
All Implemented Interfaces:
StringLookupDao<POJO>

public class SimpleStringLookupDao<POJO extends SimpleStringLookupPojo<POJO>>
extends Dao<POJO>
implements StringLookupDao<POJO>
Used for simple string lookups, typically of DB data type varchar(255) though may be shorter than 255 in some cases. These string lookups do NOT use a hash value for indexing
  • Constructor Details

    • SimpleStringLookupDao

      public SimpleStringLookupDao​(java.lang.Class<POJO> pojoType) throws java.lang.IllegalArgumentException
      Instantiates a new Simple string lookup dao using the provided pojo type
      Parameters:
      pojoType - the pojo type
      Throws:
      java.lang.IllegalArgumentException - if a dao has already been instantiated for the provided pojoType
  • Method Details

    • getOrCreate

      public POJO getOrCreate​(java.lang.String string)
      Description copied from interface: StringLookupDao
      Gets or creates a string lookup pojo representing the provided string
      Specified by:
      getOrCreate in interface StringLookupDao<POJO extends SimpleStringLookupPojo<POJO>>
      Parameters:
      string - the string
      Returns:
      the or create
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class Dao<POJO extends SimpleStringLookupPojo<POJO>>
    • get

      public static <P extends DbPojo,​ D extends Dao<P>> D get​(java.lang.Class<P> lookupPojoType)
      Gets the representing the provided SimpleStringLookupPojo type
      Type Parameters:
      P - the type parameter
      D - the type parameter
      Parameters:
      lookupPojoType - the lookup pojo type
      Returns:
      the d