Retrieving data from multiple table using hql

Query query = session.createSQLQuery(sql);
            records = query.list();
            for (Object[] fields : records) {
                Library view = new Library();
                view.setId(StringUtils.toString(fields[1]));
                view.setLName(StringUtils.toString(fields[0]));
                list.add(view);
            }
Advertisements

Angular JS Remove Blank option from Select Option

While all the suggestions above are working, sometimes I need to have an empty selection (showing placeholder text) when initially enter my screen. So, to prevent select box from adding this empty selection at the beginning (or sometimes at the end) of my list I am using this trick:

HTML Code

ng-app="MyApp1">
ng-controller="MyController"> type="text" ng-model="feed.name" placeholder="Name" /> ng-model="feed.config" ng-options="template.value as template.name for template in feed.configs" placeholder="Config"> value="" selected hidden />
</div>

Now you have defined this empty option, so select box is happy, but you keep it hidden.