Tabnine Logo
History.toDto
Code IndexAdd Tabnine to your IDE (free)

How to use
toDto
method
in
org.kaaproject.kaa.server.common.dao.model.sql.History

Best Java code snippets using org.kaaproject.kaa.server.common.dao.model.sql.History.toDto (Showing top 1 results out of 315)

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;
}
org.kaaproject.kaa.server.common.dao.model.sqlHistorytoDto

Popular methods of History

  • <init>
    Create new instance of History.
  • createDto
  • getApplication
  • getStringId
  • setApplication
  • setChange
  • setLastModifyTime
  • setSequenceNumber

Popular in Java

  • Finding current android device location
  • notifyDataSetChanged (ArrayAdapter)
  • setScale (BigDecimal)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • JList (javax.swing)
  • Top plugins for Android Studio
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