// Path: frostillicus-blog/frostillicus-blog-shared/src/main/java/model/Link.java
// @Entity @Data @NoArgsConstructor
// public class Link {
// 	@Id @Column private String id;
// 	@Column private String category;
// 	@Column("link_url") @NotEmpty private String url;
// 	@Column("link_name") @NotEmpty private String name;
// 	@Column("link_visible") @Convert(BooleanYNConverter.class) private boolean visible;
// 	@Column private String rel;
// 	@Column private boolean isConflict;
// }
// 
// Path: frostillicus-blog/frostillicus-blog-shared/src/main/java/model/LinkRepository.java
// @RepositoryProvider(AppDatabaseDef.STORE_CONFIG)
// public interface LinkRepository extends DarwinoRepository<Link, String> {
// 	Stream<Link> findAll();
// 
// 	@Query("select * from Link order by category name")
// 	List<Link> findAllByCategoryAndName();
// }


import java.util.Collection;
import java.util.Comparator;
import java.util.Map;
import java.util.TreeMap;
import java.util.TreeSet;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import javax.inject.Named;
import model.Link;
import model.LinkRepository;
/*
 * Copyright © 2012-2020 Jesse Gallagher
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package bean;




@ApplicationScoped @Named("links")
public class LinksBean {
	@Inject
	LinkRepository links;

	private static Comparator<Link> linkComparator = (o1, o2) -> String.valueOf(o1.getName()).compareTo(o2.getName());

	public Map<String, Collection<Link>> getByCategory() {
// Path: frostillicus-blog/frostillicus-blog-shared/src/main/java/model/Link.java
// @Entity @Data @NoArgsConstructor
// public class Link {
// 	@Id @Column private String id;
// 	@Column private String category;
// 	@Column("link_url") @NotEmpty private String url;
// 	@Column("link_name") @NotEmpty private String name;
// 	@Column("link_visible") @Convert(BooleanYNConverter.class) private boolean visible;
// 	@Column private String rel;
// 	@Column private boolean isConflict;
// }
// 
// Path: frostillicus-blog/frostillicus-blog-shared/src/main/java/model/LinkRepository.java
// @RepositoryProvider(AppDatabaseDef.STORE_CONFIG)
// public interface LinkRepository extends DarwinoRepository<Link, String> {
// 	Stream<Link> findAll();
// 
// 	@Query("select * from Link order by category name")
// 	List<Link> findAllByCategoryAndName();
// }


// Path: frostillicus-blog/frostillicus-blog-j2ee/src/main/java/bean/LinksBean.java
import java.util.Collection;
import java.util.Comparator;
import java.util.Map;
import java.util.TreeMap;
import java.util.TreeSet;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
import javax.inject.Named;
import model.Link;
import model.LinkRepository;

/*
 * Copyright © 2012-2020 Jesse Gallagher
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package bean;




@ApplicationScoped @Named("links")
public class LinksBean {
	@Inject
	LinkRepository links;

	private static Comparator<Link> linkComparator = (o1, o2) -> String.valueOf(o1.getName()).compareTo(o2.getName());

	public Map<String, Collection<Link>> getByCategory() {
		Map<String, Collection<Link>> result = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);