congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
TenantDao
Code IndexAdd Tabnine to your IDE (free)

How to use
TenantDao
in
org.kaaproject.kaa.server.common.dao.impl

Best Java code snippets using org.kaaproject.kaa.server.common.dao.impl.TenantDao (Showing top 8 results out of 315)

origin: kaaproject/kaa

@Override
public TenantDto findTenantByName(String name) {
 TenantDto tenantDto = null;
 if (StringUtils.isNotBlank(name)) {
  tenantDto = getDto(tenantDao.findByName(name));
 }
 return tenantDto;
}
origin: kaaproject/kaa

@Override
public List<TenantDto> findAllTenants() {
 return convertDtoList(tenantDao.find());
}
origin: kaaproject/kaa

@Override
public void removeTenantById(String tenantId) {
 LOG.debug("Try to remove tenant by id {}", tenantId);
 if (isValidSqlId(tenantId)) {
  tenantDao.removeById(tenantId);
 }
}
origin: kaaproject/kaa

@Override
public TenantDto saveTenant(TenantDto tenantDto) {
 LOG.trace("Try to save tenant object: {}", tenantDto);
 TenantDto tenant = null;
 if (isValidSqlObject(tenantDto)) {
  Tenant checkTenant = tenantDao.findByName(tenantDto.getName());
  if (checkTenant == null || checkTenant.getId().toString().equals(tenantDto.getId())) {
   tenant = getDto(tenantDao.save(new Tenant(tenantDto)));
  } else {
   throw new IncorrectParameterException("Can't save tenant with same name");
  }
 }
 return tenant;
}
origin: kaaproject/kaa

 @Test
 public void testRemoveTenantByName() {
  Tenant tenant = generateTenant();
  Tenant found = tenantDao.findByName(tenant.getName());
  Assert.assertNotNull(found);
  tenantDao.removeByName(tenant.getName());
  found = tenantDao.findByName(tenant.getName());
  Assert.assertNull(found);
 }
}
origin: kaaproject/kaa

protected Tenant generateTenant() {
 LOG.debug("Generate tenant...");
 Tenant tenant = new Tenant();
 tenant.setName("Test tenant" + RANDOM.nextInt());
 tenant = tenantDao.save(tenant);
 LOG.debug("Generate tenant {}", tenant);
 return tenant;
}
origin: kaaproject/kaa

@Override
public TenantDto findTenantById(String id) {
 TenantDto tenantDto = null;
 if (isValidSqlId(id)) {
  tenantDto = getDto(tenantDao.findById(id));
 }
 return tenantDto;
}
origin: kaaproject/kaa

@Override
public void removeTenantAdminById(String tenantId) {
 if (isValidSqlId(tenantId)) {
  LOG.debug("Remove by tenant id [{}]", tenantId);
  tenantDao.removeById(tenantId);
 }
}
org.kaaproject.kaa.server.common.dao.implTenantDao

Javadoc

The interface Tenant dao.

Most used methods

  • findByName
    Find tenant by name.
  • save
  • find
  • findById
  • removeById
  • removeByName
    Removes tenant by name.

Popular in Java

  • Reactive rest calls using spring rest template
  • getResourceAsStream (ClassLoader)
  • findViewById (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • JList (javax.swing)
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Top 17 Plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now