Tabnine Logo
IdentifierValue.getDefaultValue
Code IndexAdd Tabnine to your IDE (free)

How to use
getDefaultValue
method
in
org.hibernate.engine.spi.IdentifierValue

Best Java code snippets using org.hibernate.engine.spi.IdentifierValue.getDefaultValue (Showing top 3 results out of 315)

origin: hibernate/hibernate-orm

@Override
public void resetIdentifier(
    Object entity,
    Serializable currentId,
    Object currentVersion,
    SharedSessionContractImplementor session) {
  //noinspection StatementWithEmptyBody
  if ( entityMetamodel.getIdentifierProperty().getIdentifierGenerator() instanceof Assigned ) {
  }
  else {
    //reset the id
    Serializable result = entityMetamodel.getIdentifierProperty()
        .getUnsavedValue()
        .getDefaultValue( currentId );
    setIdentifier( entity, result, session );
    //reset the version
    VersionProperty versionProperty = entityMetamodel.getVersionProperty();
    if ( entityMetamodel.isVersioned() ) {
      setPropertyValue(
          entity,
          entityMetamodel.getVersionPropertyIndex(),
          versionProperty.getUnsavedValue().getDefaultValue( currentVersion )
      );
    }
  }
}
origin: org.hibernate/com.springsource.org.hibernate

/**
 * {@inheritDoc}
 */
public void resetIdentifier(
    Object entity,
    Serializable currentId,
    Object currentVersion,
    SessionImplementor session) {
  if ( entityMetamodel.getIdentifierProperty().getIdentifierGenerator() instanceof Assigned ) {
  }
  else {
    //reset the id
    Serializable result = entityMetamodel.getIdentifierProperty()
        .getUnsavedValue()
        .getDefaultValue( currentId );
    setIdentifier( entity, result, session );
    //reset the version
    VersionProperty versionProperty = entityMetamodel.getVersionProperty();
    if ( entityMetamodel.isVersioned() ) {
      setPropertyValue(
          entity,
          entityMetamodel.getVersionPropertyIndex(),
          versionProperty.getUnsavedValue().getDefaultValue( currentVersion )
      );
    }
  }
}
origin: org.hibernate/com.springsource.org.hibernate.core

/**
 * {@inheritDoc}
 */
public void resetIdentifier(
    Object entity,
    Serializable currentId,
    Object currentVersion,
    SessionImplementor session) {
  if ( entityMetamodel.getIdentifierProperty().getIdentifierGenerator() instanceof Assigned ) {
  }
  else {
    //reset the id
    Serializable result = entityMetamodel.getIdentifierProperty()
        .getUnsavedValue()
        .getDefaultValue( currentId );
    setIdentifier( entity, result, session );
    //reset the version
    VersionProperty versionProperty = entityMetamodel.getVersionProperty();
    if ( entityMetamodel.isVersioned() ) {
      setPropertyValue(
          entity,
          entityMetamodel.getVersionPropertyIndex(),
          versionProperty.getUnsavedValue().getDefaultValue( currentVersion )
      );
    }
  }
}
org.hibernate.engine.spiIdentifierValuegetDefaultValue

Popular methods of IdentifierValue

  • <init>
    Assume the transient instance is newly instantiated if its identifier is null or equal to value
  • isUnsaved
    Does the given identifier belong to a new instance?

Popular in Java

  • Finding current android device location
  • onCreateOptionsMenu (Activity)
  • addToBackStack (FragmentTransaction)
  • setContentView (Activity)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now