Codota Logo
HibernateTemplate.isCheckWriteOperations
Code IndexAdd Codota to your IDE (free)

How to use
isCheckWriteOperations
method
in
org.springframework.orm.hibernate5.HibernateTemplate

Best Java code snippets using org.springframework.orm.hibernate5.HibernateTemplate.isCheckWriteOperations (Showing top 3 results out of 315)

  • Common ways to obtain HibernateTemplate
private void myMethod () {
HibernateTemplate h =
  • Codota IconSessionFactory sessionFactory;new HibernateTemplate(sessionFactory)
  • Smart code suggestions by Codota
}
origin: spring-projects/spring-framework

/**
 * Check whether write operations are allowed on the given Session.
 * <p>Default implementation throws an InvalidDataAccessApiUsageException in
 * case of {@code FlushMode.MANUAL}. Can be overridden in subclasses.
 * @param session current Hibernate Session
 * @throws InvalidDataAccessApiUsageException if write operations are not allowed
 * @see #setCheckWriteOperations
 * @see Session#getFlushMode()
 * @see FlushMode#MANUAL
 */
protected void checkWriteOperationAllowed(Session session) throws InvalidDataAccessApiUsageException {
  if (isCheckWriteOperations() && SessionFactoryUtils.getFlushMode(session).lessThan(FlushMode.COMMIT)) {
    throw new InvalidDataAccessApiUsageException(
        "Write operations are not allowed in read-only mode (FlushMode.MANUAL): "+
        "Turn your Session into FlushMode.COMMIT/AUTO or remove 'readOnly' marker from transaction definition.");
  }
}
origin: org.springframework/spring-orm

/**
 * Check whether write operations are allowed on the given Session.
 * <p>Default implementation throws an InvalidDataAccessApiUsageException in
 * case of {@code FlushMode.MANUAL}. Can be overridden in subclasses.
 * @param session current Hibernate Session
 * @throws InvalidDataAccessApiUsageException if write operations are not allowed
 * @see #setCheckWriteOperations
 * @see Session#getFlushMode()
 * @see FlushMode#MANUAL
 */
protected void checkWriteOperationAllowed(Session session) throws InvalidDataAccessApiUsageException {
  if (isCheckWriteOperations() && SessionFactoryUtils.getFlushMode(session).lessThan(FlushMode.COMMIT)) {
    throw new InvalidDataAccessApiUsageException(
        "Write operations are not allowed in read-only mode (FlushMode.MANUAL): "+
        "Turn your Session into FlushMode.COMMIT/AUTO or remove 'readOnly' marker from transaction definition.");
  }
}
origin: apache/servicemix-bundles

/**
 * Check whether write operations are allowed on the given Session.
 * <p>Default implementation throws an InvalidDataAccessApiUsageException in
 * case of {@code FlushMode.MANUAL}. Can be overridden in subclasses.
 * @param session current Hibernate Session
 * @throws InvalidDataAccessApiUsageException if write operations are not allowed
 * @see #setCheckWriteOperations
 * @see Session#getFlushMode()
 * @see FlushMode#MANUAL
 */
protected void checkWriteOperationAllowed(Session session) throws InvalidDataAccessApiUsageException {
  if (isCheckWriteOperations() && SessionFactoryUtils.getFlushMode(session).lessThan(FlushMode.COMMIT)) {
    throw new InvalidDataAccessApiUsageException(
        "Write operations are not allowed in read-only mode (FlushMode.MANUAL): "+
        "Turn your Session into FlushMode.COMMIT/AUTO or remove 'readOnly' marker from transaction definition.");
  }
}
org.springframework.orm.hibernate5HibernateTemplateisCheckWriteOperations

Javadoc

Return whether to check that the Hibernate Session is not in read-only mode in case of write operations (save/update/delete).

Popular methods of HibernateTemplate

  • delete
  • save
  • <init>
    Create a new HibernateTemplate instance.
  • find
  • get
  • load
  • update
  • getSessionFactory
    Return the Hibernate SessionFactory that should be used to create Hibernate Sessions.
  • executeWithNativeSession
    Execute the action specified by the given action object within a native Session. This execute varian
  • findByNamedParam
  • merge
  • afterPropertiesSet
  • merge,
  • afterPropertiesSet,
  • createSessionProxy,
  • disableFilters,
  • doExecute,
  • enableFilters,
  • findByCriteria,
  • findByNamedQueryAndNamedParam,
  • getFilterNames

Popular in Java

  • Finding current android device location
  • findViewById (Activity)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • getApplicationContext (Context)
  • Kernel (java.awt.image)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • URI (java.net)
    Represents a Uniform Resource Identifier (URI) reference. Aside from some minor deviations noted bel
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • BoxLayout (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now