All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.buschmais.xo.impl.proxy.entity.composite.GetIdMethod Maven / Gradle / Ivy

The newest version!
package com.buschmais.xo.impl.proxy.entity.composite;

import com.buschmais.xo.api.proxy.ProxyMethod;
import com.buschmais.xo.impl.SessionContext;

/**
 * Implementation of {@link com.buschmais.xo.api.CompositeObject#getId()}.
 */
public class GetIdMethod implements ProxyMethod {

    private final SessionContext sessionContext;

    public GetIdMethod(SessionContext sessionContext) {
        this.sessionContext = sessionContext;
    }

    @Override
    public Object invoke(Entity entity, Object instance, Object[] args) {
        return sessionContext.getDatastoreSession()
            .getDatastoreEntityManager()
            .getEntityId(entity);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy