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

com.github.fluent.hibernate.request.SQLEntityToAdd Maven / Gradle / Ivy

Go to download

A library to work with Hibernate by fluent API. This library hasn't dependencies except Hibernate dependencies. It requires Java 1.6 and above.

The newest version!
package com.github.fluent.hibernate.request;

import org.hibernate.SQLQuery;

/**
 * An entity for a native SQL.
 *
 * @author V.Ladynev
 */
/* package */final class SQLEntityToAdd implements IToAddToSQLQuery {

    private String tableAlias;

    private Class entityType;

    public SQLEntityToAdd(String tableAlias, Class entityType) {
        this.tableAlias = tableAlias;
        this.entityType = entityType;
    }

    @Override
    public void addToQuery(SQLQuery query) {
        if (tableAlias == null) {
            query.addEntity(entityType);
        } else {
            query.addEntity(tableAlias, entityType);
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy