Skip to content

Commit

Permalink
DATAJPA-98 - Formatted sources with Spring Data Eclipse formatting se…
Browse files Browse the repository at this point in the history
…ttings.
  • Loading branch information
odrotbohm committed Sep 2, 2011
1 parent d5651cd commit b291a5f
Show file tree
Hide file tree
Showing 103 changed files with 6,446 additions and 7,363 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Expand Up @@ -2,4 +2,6 @@ target/
.settings/
.project
.classpath
.springBeans
.springBeans
.sonar4clipse
*.sonar4clipseExternals
291 changes: 291 additions & 0 deletions formatting.xml

Large diffs are not rendered by default.

219 changes: 104 additions & 115 deletions src/main/java/org/springframework/data/jpa/domain/AbstractAuditable.java
Expand Up @@ -26,126 +26,115 @@
import org.joda.time.DateTime;
import org.springframework.data.domain.Auditable;


/**
* Abstract base class for auditable entities. Stores the audition values in
* persistent fields.
* Abstract base class for auditable entities. Stores the audition values in persistent fields.
*
* @author Oliver Gierke
* @param <U> the auditing type. Typically some kind of user.
* @param <PK> the type of the auditing type's idenifier
*/
@MappedSuperclass
public abstract class AbstractAuditable<U, PK extends Serializable> extends
AbstractPersistable<PK> implements Auditable<U, PK> {

private static final long serialVersionUID = 141481953116476081L;

@OneToOne
private U createdBy;

@Temporal(TemporalType.TIMESTAMP)
private Date createdDate;

@OneToOne
private U lastModifiedBy;

@Temporal(TemporalType.TIMESTAMP)
private Date lastModifiedDate;


/*
* (non-Javadoc)
*
* @see org.springframework.data.domain.Auditable#getCreatedBy()
*/
public U getCreatedBy() {

return createdBy;
}


/*
* (non-Javadoc)
*
* @see
* org.springframework.data.domain.Auditable#setCreatedBy(java.lang.Object)
*/
public void setCreatedBy(final U createdBy) {

this.createdBy = createdBy;
}


/*
* (non-Javadoc)
*
* @see org.springframework.data.domain.Auditable#getCreatedDate()
*/
public DateTime getCreatedDate() {

return null == createdDate ? null : new DateTime(createdDate);
}


/*
* (non-Javadoc)
*
* @see
* org.springframework.data.domain.Auditable#setCreatedDate(org.joda.time
* .DateTime)
*/
public void setCreatedDate(final DateTime createdDate) {

this.createdDate = null == createdDate ? null : createdDate.toDate();
}


/*
* (non-Javadoc)
*
* @see org.springframework.data.domain.Auditable#getLastModifiedBy()
*/
public U getLastModifiedBy() {

return lastModifiedBy;
}


/*
* (non-Javadoc)
*
* @see
* org.springframework.data.domain.Auditable#setLastModifiedBy(java.lang
* .Object)
*/
public void setLastModifiedBy(final U lastModifiedBy) {

this.lastModifiedBy = lastModifiedBy;
}


/*
* (non-Javadoc)
*
* @see org.springframework.data.domain.Auditable#getLastModifiedDate()
*/
public DateTime getLastModifiedDate() {

return null == lastModifiedDate ? null : new DateTime(lastModifiedDate);
}


/*
* (non-Javadoc)
*
* @see
* org.springframework.data.domain.Auditable#setLastModifiedDate(org.joda
* .time.DateTime)
*/
public void setLastModifiedDate(final DateTime lastModifiedDate) {

this.lastModifiedDate =
null == lastModifiedDate ? null : lastModifiedDate.toDate();
}
public abstract class AbstractAuditable<U, PK extends Serializable> extends AbstractPersistable<PK> implements
Auditable<U, PK> {

private static final long serialVersionUID = 141481953116476081L;

@OneToOne
private U createdBy;

@Temporal(TemporalType.TIMESTAMP)
private Date createdDate;

@OneToOne
private U lastModifiedBy;

@Temporal(TemporalType.TIMESTAMP)
private Date lastModifiedDate;

/*
* (non-Javadoc)
*
* @see org.springframework.data.domain.Auditable#getCreatedBy()
*/
public U getCreatedBy() {

return createdBy;
}

/*
* (non-Javadoc)
*
* @see
* org.springframework.data.domain.Auditable#setCreatedBy(java.lang.Object)
*/
public void setCreatedBy(final U createdBy) {

this.createdBy = createdBy;
}

/*
* (non-Javadoc)
*
* @see org.springframework.data.domain.Auditable#getCreatedDate()
*/
public DateTime getCreatedDate() {

return null == createdDate ? null : new DateTime(createdDate);
}

/*
* (non-Javadoc)
*
* @see
* org.springframework.data.domain.Auditable#setCreatedDate(org.joda.time
* .DateTime)
*/
public void setCreatedDate(final DateTime createdDate) {

this.createdDate = null == createdDate ? null : createdDate.toDate();
}

/*
* (non-Javadoc)
*
* @see org.springframework.data.domain.Auditable#getLastModifiedBy()
*/
public U getLastModifiedBy() {

return lastModifiedBy;
}

/*
* (non-Javadoc)
*
* @see
* org.springframework.data.domain.Auditable#setLastModifiedBy(java.lang
* .Object)
*/
public void setLastModifiedBy(final U lastModifiedBy) {

this.lastModifiedBy = lastModifiedBy;
}

/*
* (non-Javadoc)
*
* @see org.springframework.data.domain.Auditable#getLastModifiedDate()
*/
public DateTime getLastModifiedDate() {

return null == lastModifiedDate ? null : new DateTime(lastModifiedDate);
}

/*
* (non-Javadoc)
*
* @see
* org.springframework.data.domain.Auditable#setLastModifiedDate(org.joda
* .time.DateTime)
*/
public void setLastModifiedDate(final DateTime lastModifiedDate) {

this.lastModifiedDate = null == lastModifiedDate ? null : lastModifiedDate.toDate();
}
}

0 comments on commit b291a5f

Please sign in to comment.