Hibernate ORM ClassMetadata - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Hibernate ORM ClassMetadata class.

This code example shows how to use the following methods:getIdentifier
		final ClassMetadata cmd = sf.getClassMetadata(entityClass);
 
		final SessionImplementor si = (SessionImplementor)(getEntityManager().getDelegate());
 
		@SuppressWarnings("unchecked") 
		final ID result = (ID) cmd.getIdentifier(entity, si);
		return result;
	} 
 
	/** 
	 * {@inheritDoc} 
	 */ 
	public T persist(T entity) {
 
		// Case of new, non-persisted entity 
		if (extractId(entity) == null) {
			getEntityManager().persist(entity);
		} 
	 
		else if (!getEntityManager().contains(entity)) {
4
CodeRank
See Code Examples for Hibernate ORM ClassMetadata Methods: