Java examples for javax.persistence:EntityManager
get Select All Query Sql for AbstractEntity
import java.io.Serializable; import javax.persistence.EntityExistsException; import javax.persistence.EntityManager; public class Main{ public static void main(String[] argv) throws Exception{ Class entityType = String.class; System.out.println(getSelectAllQuerySql(entityType)); }/*from w ww.j a v a2 s . c o m*/ public static String getSelectAllQuerySql( Class<? extends AbstractEntity> entityType) { if (entityType == null) return ""; return "select e from " + entityType.getSimpleName() + " as e"; } }