class - java generate th list of objects from database -


i have 2 classes:

public abstract class entry {     private static string list_query     = "select * \"%s\"";     .     .     .     protected static <t extends entity> list<t> all(class<t> cls) { /*here want load whole database. each row create own object. example article(class below)*/    } }  class article extends entry {    .    .    .     public static list<article> all() throws sqlexception {         return entry.all(article.class);    } } 

question how inside entry.all() method create article objects or object inherited entry? variants wrong:

cls<t> instance_of_entity = new cls<t>();//wrong cls instance_of_entity = new cls();//wrong 


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -