本文整理汇总了Java中eu.atos.sla.datamodel.bean.Variable类的典型用法代码示例。如果您正苦于以下问题:Java Variable类的具体用法?Java Variable怎么用?Java Variable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Variable类属于eu.atos.sla.datamodel.bean包,在下文中一共展示了Variable类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getByName
import eu.atos.sla.datamodel.bean.Variable; //导入依赖的package包/类
@Override
public IVariable getByName(String name) {
try {
TypedQuery<IVariable> query = entityManager.createNamedQuery(
Variable.QUERY_FIND_BY_NAME, IVariable.class);
query.setParameter("name", name);
IVariable variable = new Variable();
variable = query.getSingleResult();
return variable;
} catch (NoResultException e) {
logger.debug("No Result found: " + e);
return null;
}
}
示例2: getAll
import eu.atos.sla.datamodel.bean.Variable; //导入依赖的package包/类
@Override
public List<IVariable> getAll() {
TypedQuery<IVariable> query = entityManager.createNamedQuery(
Variable.QUERY_FIND_ALL, IVariable.class);
List<IVariable> services = new ArrayList<IVariable>();
services = query.getResultList();
if (services != null) {
logger.debug("Number of services:" + services.size());
} else {
logger.debug("No Result found.");
}
return services;
}
示例3: getByName
import eu.atos.sla.datamodel.bean.Variable; //导入依赖的package包/类
@Override
public IVariable getByName(String name) {
try {
TypedQuery<IVariable> query = entityManager.createNamedQuery(
Variable.QUERY_FIND_BY_NAME, IVariable.class);
query.setParameter("name", name);
IVariable variable = new Variable();
variable = query.getSingleResult();
return variable;
} catch (NoResultException e) {
logger.debug("No Result found: " + e);
return null;
}
}
示例4: getAll
import eu.atos.sla.datamodel.bean.Variable; //导入依赖的package包/类
@Override
public List<IVariable> getAll() {
TypedQuery<IVariable> query = entityManager.createNamedQuery(
Variable.QUERY_FIND_ALL, IVariable.class);
List<IVariable> services = new ArrayList<IVariable>();
services = query.getResultList();
if (services != null) {
logger.debug("Number of services:" + services.size());
} else {
logger.debug("No Result found.");
}
return services;
}
示例5: delete
import eu.atos.sla.datamodel.bean.Variable; //导入依赖的package包/类
@Override
public boolean delete(IVariable variable) {
try {
variable = entityManager
.getReference(Variable.class, variable.getId());
entityManager.remove(variable);
entityManager.flush();
return true;
} catch (EntityNotFoundException e) {
logger.debug("Variable[{}] not found", variable.getId());
return false;
}
}
示例6: delete
import eu.atos.sla.datamodel.bean.Variable; //导入依赖的package包/类
@Override
public boolean delete(IVariable variable) {
try {
variable = entityManager
.getReference(Variable.class, variable.getId());
entityManager.remove(variable);
entityManager.flush();
return true;
} catch (EntityNotFoundException e) {
logger.debug("Variable[{}] not found", variable.getId());
return false;
}
}
示例7: getById
import eu.atos.sla.datamodel.bean.Variable; //导入依赖的package包/类
@Override
public Variable getById(Long id) {
return entityManager.find(Variable.class, id);
}
示例8: getById
import eu.atos.sla.datamodel.bean.Variable; //导入依赖的package包/类
@Override
public Variable getById(Long id) {
return entityManager.find(Variable.class, id);
}
示例9: getById
import eu.atos.sla.datamodel.bean.Variable; //导入依赖的package包/类
/**
* Returns the variable from the database by its Id
*
* @param id
* of the variable
* @return the corresponding variable from the database
*/
public Variable getById(Long id);