Package com.logicaldoc.core

# Class PersistentObject

java.lang.Object
com.logicaldoc.core.PersistentObject

All Implemented Interfaces:
  `Serializable`

Direct Known Subclasses:
  `ApiKey`, `AttributeOption`, `Bookmark`, `Contact`, `Dashlet`, `Device`, `DocumentLink`, `DocumentNote`, `ExtensibleObject`, `Filler`, `Group`, `History`, `Menu`, `Message`, `MessageTemplate`, `PasswordHistory`, `Rating`, `SavedSearch`, `Sequence`, `Session`, `Tenant`, `Ticket`, `User`

@MappedSuperclass public abstract class PersistentObject extends Object implements Serializable
This abstract class defines the minimum requirements of persistent objects.

Since:
  4.0
Author:
  Marco Meschieri - LogicalDOC
See Also:
  - Serialized Form

## Field Summary

Fields
Modifier and Type
Field
Description
`static final int`
`DELETED_CODE_DEFAULT`
This is used to mark a deletion that must be shown in the trash bin
`static final int`
`DELETED_CODE_STRONG`
This is used to mark a deletion that must be physically removed
`long`
`id`

## Constructor Summary

Constructors
Constructor
Description
`PersistentObject()`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object obj)`
`Date`
`getCreation()`
The object's creation date
`int`
`getDeleted()`
This flag is used to mark an object as deleted
`long`
`getId()`
Unique identifier in the data store
`Date`
`getLastModified()`
The last time this instance was modified
`long`
`getRecordVersion()`
`long`
`getTenantId()`
`int`
`hashCode()`
`void`
`setCreation(Date creation)`
`void`
`setDeleted(int deleted)`
`void`
`setId(long id)`
`void`
`setLastModified(Date lastModified)`
`void`
`setRecordVersion(long recordVersion)`
`void`
`setTenantId(long tenantId)`
`String`
`toString()`

### Methods inherited from class java.lang.Object

`getClass, notify, notifyAll, wait, wait, wait`

## Field Details

### DELETED_CODE_DEFAULT

public static final int DELETED_CODE_DEFAULT
This is used to mark a deletion that must be shown in the trash bin

See Also:
  - Constant Field Values

### DELETED_CODE_STRONG

public static final int DELETED_CODE_STRONG
This is used to mark a deletion that must be physically removed

See Also:
  - Constant Field Values

### id

public long id

## Constructor Details

### PersistentObject

public PersistentObject()

## Method Details

### getId

public long getId()
Unique identifier in the data store

Returns:
  the unique identifier of this record

### setId

public void setId(long id)

### getLastModified

public Date getLastModified()
The last time this instance was modified

Returns:
  the last modified date

### setLastModified

public void setLastModified(Date lastModified)

### getDeleted

public int getDeleted()
This flag is used to mark an object as deleted

Returns:
  1 if the record is deleted, 0 otherwise

### setDeleted

public void setDeleted(int deleted)

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### getTenantId

public long getTenantId()

### setTenantId

public void setTenantId(long tenantId)

### getRecordVersion

public long getRecordVersion()

### setRecordVersion

public void setRecordVersion(long recordVersion)

### getCreation

public Date getCreation()
The object's creation date

Returns:
  the creation date

### setCreation

public void setCreation(Date creation)

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### equals

public boolean equals(Object obj)

Overrides:
  `equals` in class `Object`