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

com.swingfrog.summer.ecs.component.AbstractBeanBaseComponent Maven / Gradle / Ivy

There is a newer version: 1.1.18
Show newest version
package com.swingfrog.summer.ecs.component;

import com.swingfrog.summer.app.Summer;
import com.swingfrog.summer.db.repository.Repository;
import com.swingfrog.summer.ecs.EcsRuntimeException;
import com.swingfrog.summer.ecs.annotation.BindRepository;
import com.swingfrog.summer.ecs.entity.Entity;

public abstract class AbstractBeanBaseComponent> extends AbstractComponent {

    final Repository repository;

    public AbstractBeanBaseComponent(E entity) {
        super(entity);
        BindRepository bindRepository = this.getClass().getAnnotation(BindRepository.class);
        if (bindRepository == null)
            throw new EcsRuntimeException("not found @BindRepository -> %s", this.getClass().getName());
        repository = Summer.getComponent(bindRepository.value());
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy