Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (C) 2014 Philip Helger (www.helger.com) philip[at]helger[dot]com Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
package com.helger.appbasics.app.dao;
Base DAO interface. DAO = Data Access Object. A DAO implementation usually has 3 basic operations:
  • Initialization - when no file exists and an initial setup can be performed.
  • Reading - read existing data from a file
  • Write - write modified data to a file

Author(s):
Philip Helger
public interface IDAO extends IChangeableIAutoSaveAware
  public enum EMode
  {
    READ,
    WRITE;
  }

  
This method is called to persist the content in disk in case there are pending changes. If no pending changes are present, nothing happens. In case the implementation is thread-safe, this method must be thread-safe!

Returns:
The number of times this DAO was initialized. Always ≥ 0. Usually this field is not persistent and only is valid until the application ends.
  int getInitCount ();

  

Returns:
The last time this DAO was initialized (without error). May be null if it wasn't read before. Usually this field is not persistent and only is valid until the application ends.

Returns:
The number of times this DAO was initialized. Always ≥ 0. Usually this field is not persistent and only is valid until the application ends.
  int getReadCount ();

  

Returns:
The last time this DAO was read (without error). May be null if it wasn't read before. Usually this field is not persistent and only is valid until the application ends.

Returns:
The number of times this DAO was initialized. Always ≥ 0. Usually this field is not persistent and only is valid until the application ends.
  int getWriteCount ();

  

Returns:
The last time this DAO was written (without error). May be null if it wasn't written before. Usually this field is not persistent and only is valid until the application ends.
New to GrepCode? Check out our FAQ X