Code example for ClassMetadata

Methods: getIdentifier

0
		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)) {