Tabnine Logo
javax.jdo.identity
Code IndexAdd Tabnine to your IDE (free)

How to use javax.jdo.identity

Best Java code snippets using javax.jdo.identity (Showing top 20 results out of 315)

origin: apache/hive

@Override
public int addMasterKey(String key) throws MetaException{
 LOG.debug("Begin executing addMasterKey");
 boolean committed = false;
 MMasterKey masterKey = new MMasterKey(key);
 try{
  openTransaction();
  pm.makePersistent(masterKey);
  committed = commitTransaction();
 } finally {
  if(!committed) {
   rollbackTransaction();
  }
 }
 LOG.debug("Done executing addMasterKey with status : {}", committed);
 if (committed) {
  return ((IntIdentity)pm.getObjectId(masterKey)).getKey();
 } else {
  throw new MetaException("Failed to add master key.");
 }
}
origin: javax.jdo/jdo-api

/** Constructor with class and key.
 * @param pcClass the class
 * @param key the key
 */
public IntIdentity (Class pcClass, int key) {
  super(pcClass);
  construct(key);
}
origin: javax.jdo/jdo-api

/** Constructor with class and key.
 * @param pcClass the target class
 * @param key the key
 */
public ByteIdentity(Class pcClass, byte key) {
  super(pcClass);
  construct(key);
}

origin: javax.jdo/jdo-api

/** Return the key as an Object. The method is synchronized to avoid
 * race conditions in multi-threaded environments.
 * @return the key as an Object.
 * @since 2.0
 */
public synchronized Object getKeyAsObject() {
  if (keyAsObject == null) {
    keyAsObject = createKeyAsObject();
  }
  return keyAsObject;
}

origin: javax.jdo/jdo-api

/** Constructor with class and key.
 * @param pcClass the class
 * @param key the key
 */
public ShortIdentity (Class pcClass, short key) {
  super(pcClass);
  construct(key);
}
origin: javax.jdo/jdo-api

/** Construct this instance with the key value.
 */
private void construct(byte key) {
  this.key = key;
  hashCode = super.hashClassName() ^ key;
}

origin: javax.jdo/jdo-api

/** Constructor with class and key.
 * @param pcClass the target class
 * @param key the key
 */
public CharIdentity (Class pcClass, char key) {
  super (pcClass);
  construct(key);
}
origin: javax.jdo/jdo-api

/** Set the given key as the key for this instance. 
 * Compute the hash code for the instance.
 * @since 2.0
 */
protected void setKeyAsObject(Object key) {
  assertKeyNotNull(key);
  keyAsObject = key;
}
origin: javax.jdo/jdo-api

/** Constructor with class and key.
 * @param pcClass the class
 * @param key the key
 */
public LongIdentity (Class pcClass, long key) {
  super (pcClass);
  construct(key);
}
origin: javax.jdo/jdo-api

private void construct(char key) {
  this.key = key;
  hashCode = hashClassName() ^ key;
}
origin: org.datanucleus/javax.jdo

private void construct(long key) {
  this.key = key;
  hashCode = hashClassName() ^ (int)key;
}
origin: org.datanucleus/javax.jdo

private void construct(short key) {
  this.key = key;
  hashCode = hashClassName() ^ key;
}
origin: org.datanucleus/javax.jdo

/** Constructor with class and key.
 * @param pcClass the class
 * @param key the key
 */
public IntIdentity (Class pcClass, int key) {
  super(pcClass);
  construct(key);
}
origin: org.datanucleus/javax.jdo

/** Constructor with class and key.
 * @param pcClass the target class
 * @param key the key
 */
public ByteIdentity(Class pcClass, byte key) {
  super(pcClass);
  construct(key);
}

origin: org.datanucleus/javax.jdo

/** Return the key as an Object. The method is synchronized to avoid
 * race conditions in multi-threaded environments.
 * @return the key as an Object.
 * @since 2.0
 */
public synchronized Object getKeyAsObject() {
  if (keyAsObject == null) {
    keyAsObject = createKeyAsObject();
  }
  return keyAsObject;
}

origin: org.datanucleus/javax.jdo

/** Constructor with class and key.
 * @param pcClass the class
 * @param key the key
 */
public ShortIdentity (Class pcClass, short key) {
  super(pcClass);
  construct(key);
}
origin: org.datanucleus/javax.jdo

/** Construct this instance with the key value.
 */
private void construct(byte key) {
  this.key = key;
  hashCode = super.hashClassName() ^ key;
}

origin: org.datanucleus/javax.jdo

/** Constructor with class and key.
 * @param pcClass the target class
 * @param key the key
 */
public CharIdentity (Class pcClass, char key) {
  super (pcClass);
  construct(key);
}
origin: org.datanucleus/javax.jdo

/** Set the given key as the key for this instance. 
 * Compute the hash code for the instance.
 * @param key The key to use
 * @since 2.0
 */
protected void setKeyAsObject(Object key) {
  assertKeyNotNull(key);
  keyAsObject = key;
}
origin: org.datanucleus/javax.jdo

/** Constructor with class and key.
 * @param pcClass the class
 * @param key the key
 */
public LongIdentity (Class pcClass, long key) {
  super (pcClass);
  construct(key);
}
javax.jdo.identity

Most used classes

  • IntIdentity
    This class is for identity with a single int field.
  • SingleFieldIdentity
    This class is the abstract base class for all single field identity classes. A common case of applic
  • StringIdentity
    This class is for identity with a single String field.
  • ByteIdentity
    This class is for identity with a single byte field.
  • LongIdentity
    This class is for identity with a single long field.
  • CharIdentity,
  • ShortIdentity
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