Tabnine Logo
History.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.kaaproject.kaa.server.common.dao.model.sql.History
constructor

Best Java code snippets using org.kaaproject.kaa.server.common.dao.model.sql.History.<init> (Showing top 3 results out of 315)

origin: kaaproject/kaa

@Override
protected GenericModel<HistoryDto> newInstance(Long id) {
 return new History(id);
}
origin: kaaproject/kaa

@Override
public HistoryDto saveHistory(HistoryDto historyDto) {
 HistoryDto savedDto = null;
 if (isValidSqlObject(historyDto)) {
  LOG.debug("History dto object is valid. Saving history...");
  String applicationId = historyDto.getApplicationId();
  if (isValidSqlId(applicationId)) {
   Application application = applicationDao.getNextSeqNumber(applicationId);
   if (application != null) {
    int sequenceNumber = application.getSequenceNumber();
    historyDto.setSequenceNumber(sequenceNumber);
    historyDto.setLastModifyTime(System.currentTimeMillis());
    History savedHistory = historyDao.persist(new History(historyDto));
    savedDto = savedHistory != null ? savedHistory.toDto() : null;
   } else {
    LOG.debug("Can't get sequence number for application id [{}] .", applicationId);
   }
  } else {
   LOG.debug("Incorrect application id, can't save history.");
  }
 } else {
  LOG.info("Invalid HistoryDto object. Can't save object.");
 }
 return savedDto;
}
origin: kaaproject/kaa

protected List<History> generateHistory(Application app, int count) {
 LOG.debug("Generate history...");
 List<History> histories = new ArrayList<>();
 if (app == null) {
  app = generateApplication(null);
 }
 for (int i = 0; i < count; i++) {
  History history = new History();
  history.setApplication(app);
  history.setLastModifyTime(System.currentTimeMillis());
  history.setSequenceNumber(i + 1);
  history.setChange(generateChange());
  history = historyDao.save(history);
  histories.add(history);
  LOG.debug("Generated history {}", history);
 }
 return histories;
}
org.kaaproject.kaa.server.common.dao.model.sqlHistory<init>

Javadoc

Create new instance of History.

Popular methods of History

  • createDto
  • getApplication
  • getStringId
  • setApplication
  • setChange
  • setLastModifyTime
  • setSequenceNumber
  • toDto

Popular in Java

  • Parsing JSON documents to java classes using gson
  • notifyDataSetChanged (ArrayAdapter)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getApplicationContext (Context)
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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