/** * Creates a new MappingRuntimeException * * @param message the error message **/ public MappingRuntimeException(String message, Object[] args) { super(Messages.format(message, args)); } // -- MappingRuntimeException
/** * Format the named message using two argument and return the full message text. * * @param message The message name * @param arg1 The first argument * @param arg2 The second argument * @return The full message text */ public static String format(final String message, final Object arg1, final Object arg2) { return format(message, new Object[] {arg1, arg2}); }
/** * Creates a new MappingRuntimeException * * @param exception the Exception which caused this Exception. * @param message the error message **/ public MappingRuntimeException(Throwable exception, String message) { super(Messages.format("mapping.nested", message)); _exception = exception; } // -- MappingRuntimeException
/** * Format the named message using a single argument and return the full message text. * * @param message The message name * @param arg1 The first argument * @return The full message text */ public static String format(final String message, final Object arg1) { return format(message, new Object[] {arg1}); }
public MappingException(String message, Object arg1) { super(Messages.format(message, arg1)); }
/** * Creates a new MappingRuntimeException * * @param exception the Exception which caused this Exception. **/ public MappingRuntimeException(Throwable exception) { super(Messages.format("mapping.nested", exception.toString())); _exception = exception; } // -- MappingRuntimeException
/** * Creates an instance of this class. */ public XercesSerializer() { try { _serializer = Class.forName("org.apache.xml.serialize.XMLSerializer").newInstance(); } catch (Exception except) { throw new RuntimeException(Messages.format("conf.failedInstantiateSerializer", "org.apache.xml.serialize.XMLSerializer", except)); } }
/** * Creates an instance of this class. */ public XercesJDK5OutputFormat() { try { _outputFormat = Class.forName(CLASS_NAME).newInstance(); } catch (Exception except) { throw new RuntimeException( Messages.format("conf.failedInstantiateOutputFormat", CLASS_NAME, except)); } }
/** * Creates an instance of this class. */ public XercesOutputFormat() { try { _outputFormat = Class.forName(CLASS_NAME).newInstance(); } catch (Exception except) { throw new RuntimeException( Messages.format("conf.failedInstantiateOutputFormat", CLASS_NAME, except)); } }
/** * {@inheritDoc} */ public Long getValue(final ResultSet rs) throws PersistenceException, SQLException { if (rs.next()) { return new Long(rs.getLong(1)); } else if (!_fail) { return ZERO; } String msg = Messages.format("persist.keyGenFailed", ""); throw new PersistenceException(msg); }
/** * {@inheritDoc} */ public Integer getValue(final ResultSet rs) throws PersistenceException, SQLException { if (rs.next()) { return new Integer(rs.getInt(1)); } else if (!_fail) { return ZERO; } String msg = Messages.format("persist.keyGenFailed", ""); throw new PersistenceException(msg); }
private void assertNumericSqlType(int sqlType) throws MappingException { switch (sqlType) { case Types.BIGINT: case Types.SMALLINT: case Types.INTEGER: case Types.DECIMAL: case Types.NUMERIC: break; default: String msg = Messages.format("mapping.keyGenSQLType", getClass() .getName(), sqlType); throw new MappingException(msg); } }
/** * Creates an instance of this class. */ public BaseXercesJDK5Serializer() { try { _serializer = Class.forName(getPackageName() + ".XMLSerializer").newInstance(); } catch (Exception except) { throw new RuntimeException(Messages.format("conf.failedInstantiateSerializer", getPackageName() + ".XMLSerializer", except)); } }
public void unmarkReadOnly(final Object o) { _operation++; Object object = supportCGLibObject(o); if (!isTracking(object)) { throw new IllegalStateException(Messages.format("persist.internal", "Attempt to make read-write object that is not in transaction")); } // Add it to our list of read only objects. _readWriteSet.add(object); _readOnlySet.remove(object); }
public void markReadOnly(final Object o) { _operation++; Object object = supportCGLibObject(o); if (!isTracking(object)) { throw new IllegalStateException(Messages.format("persist.internal", "Attempt to make read-only object that is not in transaction")); } // Add it to our list of read only objects. _readOnlySet.add(object); _readWriteSet.remove(object); }
@Override public DocumentHandler getSerializer(final Writer output) throws IOException { Serializer serializer; DocumentHandler docHandler; serializer = getSerializer(); serializer.setOutputCharStream(output); docHandler = serializer.asDocumentHandler(); if (docHandler == null) { throw new RuntimeException( Messages.format("conf.serializerNotSaxCapable", serializer.getClass().getName())); } return docHandler; }
private void configureSerializer(Writer out) throws IOException { _serializer = getInternalContext().getSerializer(); if (_serializer == null) throw new RuntimeException("Unable to obtain serializer"); _serializer.setOutputCharStream(out); // -- Due to a Xerces Serializer bug that doesn't allow declaring // -- multiple prefixes to the same namespace, we use the old // -- DocumentHandler format and process namespaces ourselves _handler = new DocumentHandlerAdapter(_serializer.asDocumentHandler()); if (_handler == null) { String err = Messages.format(SERIALIZER_NOT_SAX_CAPABLE, _serializer.getClass().getName()); throw new RuntimeException(err); } }
public PersistenceQuery createQuery(final QueryExpression query, final Class[] types, final AccessMode accessMode) throws QueryException { AccessMode mode = (accessMode != null) ? accessMode : new ClassDescriptorJDONature(_clsDesc).getAccessMode(); String sql = query.getStatement(mode == AccessMode.DbLocked); if (LOG.isDebugEnabled()) { LOG.debug(Messages.format("jdo.createSql", sql)); } return new SQLQuery(this, _factory, sql, types, false); }
public final void addLimitClause(final String limit) throws SyntaxNotSupportedException { if (isLimitClauseSupported()) { _limit = limit; } else { throw new SyntaxNotSupportedException (Messages.format( "query.limitClauseNotSupported", _factory.getFactoryName())); } }
public final void addOffsetClause(final String offset) throws SyntaxNotSupportedException { if (isOffsetClauseSupported()) { _offset = offset; } else { throw new SyntaxNotSupportedException(Messages.format( "query.offsetClauseNotSupported", _factory.getFactoryName())); } }