Class DaoBuilder<T extends net.tangly.bus.core.HasOid>

java.lang.Object
net.tangly.orm.DaoBuilder<T>

public class DaoBuilder<T extends net.tangly.bus.core.HasOid>
extends java.lang.Object
Builder for the table class. Upon building the class you should discard the builder instance. Any additional call on the builder will update a runtime exception.
  • Constructor Summary

    Constructors 
    Constructor Description
    DaoBuilder​(@NotNull java.lang.Class<T> type)  
  • Method Summary

    Modifier and Type Method Description
    Dao<T> build​(java.lang.String schema, java.lang.String entity, javax.sql.DataSource dataSource)  
    net.tangly.commons.lang.Reference<Dao<T>> self()  
    DaoBuilder<T> withBigDecimal​(@NotNull java.lang.String name)  
    <U extends net.tangly.bus.codes.Code>
    DaoBuilder<T>
    withCode​(@NotNull java.lang.String name, @NotNull net.tangly.bus.codes.CodeType<U> codeType)  
    DaoBuilder<T> withDate​(@NotNull java.lang.String name)  
    DaoBuilder<T> withDateTime​(@NotNull java.lang.String name)  
    DaoBuilder<T> withFid​(@NotNull java.lang.String name)  
    DaoBuilder<T> withInt​(@NotNull java.lang.String name)
    Add an integer property and column.
    <U> DaoBuilder<T> withJson​(@NotNull java.lang.String name, @NotNull java.lang.Class<U> referenceType)  
    DaoBuilder<T> withLong​(@NotNull java.lang.String name)  
    DaoBuilder<T> withOid()
    Adds a long unique object identifier property and column.
    <R extends net.tangly.bus.core.HasOid>
    DaoBuilder<T>
    withOne2Many​(java.lang.String name, java.lang.String property, net.tangly.commons.lang.Reference<Dao<R>> reference, boolean owned)  
    <R extends net.tangly.bus.core.HasOid>
    DaoBuilder<T>
    withOne2One​(@NotNull java.lang.String name, @NotNull net.tangly.commons.lang.Reference<Dao<R>> reference, boolean owned)  
    DaoBuilder<T> withString​(@NotNull java.lang.String name)  
    DaoBuilder<T> withTags​(@NotNull java.lang.String name)  
    DaoBuilder<T> withText​(@NotNull java.lang.String name)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DaoBuilder

      public DaoBuilder​(@NotNull @NotNull java.lang.Class<T> type)
  • Method Details

    • withOid

      public DaoBuilder<T> withOid()
      Adds a long unique object identifier property and column.
      Returns:
      builder as fluent interface
    • withFid

      public DaoBuilder<T> withFid​(@NotNull @NotNull java.lang.String name)
    • withInt

      public DaoBuilder<T> withInt​(@NotNull @NotNull java.lang.String name)
      Add an integer property and column.
      Parameters:
      name - name of the property and associated column in the table
      Returns:
      builder as fluent interface
    • withLong

      public DaoBuilder<T> withLong​(@NotNull @NotNull java.lang.String name)
    • withString

      public DaoBuilder<T> withString​(@NotNull @NotNull java.lang.String name)
    • withText

      public DaoBuilder<T> withText​(@NotNull @NotNull java.lang.String name)
    • withDate

      public DaoBuilder<T> withDate​(@NotNull @NotNull java.lang.String name)
    • withDateTime

      public DaoBuilder<T> withDateTime​(@NotNull @NotNull java.lang.String name)
    • withBigDecimal

      public DaoBuilder<T> withBigDecimal​(@NotNull @NotNull java.lang.String name)
    • withTags

      public DaoBuilder<T> withTags​(@NotNull @NotNull java.lang.String name)
    • withJson

      public <U> DaoBuilder<T> withJson​(@NotNull @NotNull java.lang.String name, @NotNull @NotNull java.lang.Class<U> referenceType)
    • withCode

      public <U extends net.tangly.bus.codes.Code> DaoBuilder<T> withCode​(@NotNull @NotNull java.lang.String name, @NotNull @NotNull net.tangly.bus.codes.CodeType<U> codeType)
    • withOne2One

      public <R extends net.tangly.bus.core.HasOid> DaoBuilder<T> withOne2One​(@NotNull @NotNull java.lang.String name, @NotNull @NotNull net.tangly.commons.lang.Reference<Dao<R>> reference, boolean owned)
    • withOne2Many

      public <R extends net.tangly.bus.core.HasOid> DaoBuilder<T> withOne2Many​(java.lang.String name, java.lang.String property, net.tangly.commons.lang.Reference<Dao<R>> reference, boolean owned)
    • build

      public Dao<T> build​(java.lang.String schema, java.lang.String entity, javax.sql.DataSource dataSource) throws java.lang.NoSuchMethodException
      Throws:
      java.lang.NoSuchMethodException
    • self

      public net.tangly.commons.lang.Reference<Dao<T>> self()