com.github.longhaoteng.sdk.common.BaseEntity Maven / Gradle / Ivy
The newest version!
package com.github.longhaoteng.sdk.common;
import org.springframework.context.ApplicationContext;
/**
* BaseEntity
*
* @author mr.long
*/
public abstract class BaseEntity {
private ApplicationContext applicationContext;
public BaseEntity() {
applicationContext = ApplicationContextKeeper.getApplicationContext();
}
protected T getBean(Class beanClass) {
return applicationContext.getBean(beanClass);
}
protected T getBean(String name, Class beanClass) {
return applicationContext.getBean(name, beanClass);
}
}