Skip to content

Commit

Permalink
增加可逻辑删除的string主键类
Browse files Browse the repository at this point in the history
  • Loading branch information
phoenix committed Nov 19, 2015
1 parent f262047 commit 1518e45
Showing 1 changed file with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package edu.scup.data.jpa.repository.domain;

import org.hibernate.annotations.Type;

import javax.persistence.MappedSuperclass;

@MappedSuperclass
public abstract class UUIDLogicalDeletableEntity extends UUIDPersistable implements LogicalDeletable {
@Type(type = "org.hibernate.type.NumericBooleanType")
private Boolean deleted = false;

@Override
public void setDeleted(final boolean deleted) {
this.deleted = deleted;
}

@Override
public boolean isDeleted() {
return deleted == null ? false : deleted;
}
}

0 comments on commit 1518e45

Please sign in to comment.