blob: 603fe95c391094a74a330fd6d86e94c3dfcac3d3 [file] [log] [blame]
/*
* Copyright (c) 2008, 2009, 2011, 2012 Eike Stepper (Loehne, Germany) and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Martin Taal - copied from CDORevisionPropertyHandler and adapted
* Eike Stepper - maintenance
*/
package org.eclipse.emf.cdo.server.internal.hibernate.tuplizer;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision;
import org.hibernate.HibernateException;
/**
* @author Martin Taal
*/
public class CDOResourceIDGetter extends CDOPropertyGetter
{
private static final long serialVersionUID = 1L;
public CDOResourceIDGetter(CDORevisionTuplizer tuplizer, String propertyName)
{
super(tuplizer, propertyName);
}
@Override
public Object get(Object target) throws HibernateException
{
if (target instanceof CDOID)
{
return target;
}
return ((InternalCDORevision)target).getResourceID();
}
@Override
protected boolean isVirtualPropertyAllowed()
{
return true;
}
}