Search in sources :

Example 11 with IVoucherGenerator

use of org.jaffa.components.voucher.IVoucherGenerator in project jaffa-framework by jaffa-projects.

the class SavedQuery method generateKey.

/**
 * Generate the technical-key, if required.
 */
public void generateKey() throws ApplicationExceptions, FrameworkException {
    if (getQueryId() == null) {
        try {
            IVoucherGenerator vg = VoucherGeneratorFactory.instance();
            vg.setUow(getUOW());
            vg.setDomainClassName(getClass().getName());
            vg.setFieldName(SavedQueryMeta.QUERY_ID);
            vg.setLabelToken(SavedQueryMeta.META_QUERY_ID.getLabelToken());
            setQueryId(vg.generate());
        } catch (ValidationException e) {
            throw new ApplicationExceptions(e);
        }
    }
}
Also used : ApplicationExceptions(org.jaffa.exceptions.ApplicationExceptions) IVoucherGenerator(org.jaffa.components.voucher.IVoucherGenerator)

Aggregations

IVoucherGenerator (org.jaffa.components.voucher.IVoucherGenerator)11 ApplicationExceptions (org.jaffa.exceptions.ApplicationExceptions)9 BufferedInputStream (java.io.BufferedInputStream)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 InputStream (java.io.InputStream)1 Blob (java.sql.Blob)1 PreparedStatement (java.sql.PreparedStatement)1 SQLException (java.sql.SQLException)1 Timestamp (java.sql.Timestamp)1 Date (java.util.Date)1 List (java.util.List)1 JDBCColumnHandler (org.apache.log4j.jdbcplus.JDBCColumnHandler)1 JDBCIDHandler (org.apache.log4j.jdbcplus.JDBCIDHandler)1 JDBCLogColumn (org.apache.log4j.jdbcplus.JDBCLogColumn)1 IAttachmentData (org.jaffa.components.attachment.apis.IAttachmentData)1 DateTime (org.jaffa.datatypes.DateTime)1 MandatoryFieldException (org.jaffa.datatypes.exceptions.MandatoryFieldException)1