Search in sources :

Example 21 with Transient

use of javax.persistence.Transient in project mycore by MyCoRe-Org.

the class MCRCategoryImpl method getRightSiblingOrParent.

@Transient
MCRCategoryImpl getRightSiblingOrParent() {
    int index = getPositionInParent();
    MCRCategoryImpl parent = (MCRCategoryImpl) getParent();
    if (index + 1 == parent.getChildren().size()) {
        return parent;
    }
    // get Element at index that would be at index+1 after insert
    return (MCRCategoryImpl) parent.getChildren().get(index + 1);
}
Also used : UniqueConstraint(javax.persistence.UniqueConstraint) Transient(javax.persistence.Transient)

Example 22 with Transient

use of javax.persistence.Transient in project openolat by klemens.

the class AssessmentTestSession method getFinalScore.

/**
 * @return The score + manual score
 */
@Transient
public default BigDecimal getFinalScore() {
    BigDecimal finalScore = getScore();
    BigDecimal manualScore = getManualScore();
    if (finalScore == null) {
        finalScore = manualScore;
    } else if (manualScore != null) {
        finalScore = finalScore.add(manualScore);
    }
    return finalScore;
}
Also used : BigDecimal(java.math.BigDecimal) Transient(javax.persistence.Transient)

Aggregations

Transient (javax.persistence.Transient)22 ArrayList (java.util.ArrayList)6 UniqueConstraint (javax.persistence.UniqueConstraint)5 HashMap (java.util.HashMap)4 Method (java.lang.reflect.Method)3 RuleActionBean (org.akaza.openclinica.domain.rule.action.RuleActionBean)3 BigDecimal (java.math.BigDecimal)2 Date (java.util.Date)2 ManyToMany (javax.persistence.ManyToMany)2 ManyToOne (javax.persistence.ManyToOne)2 OneToMany (javax.persistence.OneToMany)2 OneToOne (javax.persistence.OneToOne)2 ToStringBuilder (org.apache.commons.lang.builder.ToStringBuilder)2 ObjectMapper (org.codehaus.jackson.map.ObjectMapper)2 Annotation (java.lang.annotation.Annotation)1 AnnotatedElement (java.lang.reflect.AnnotatedElement)1 Field (java.lang.reflect.Field)1 DateTimeFormatter (java.time.format.DateTimeFormatter)1 List (java.util.List)1 Access (javax.persistence.Access)1