use of javax.persistence.Transient in project FP-PSP-SERVER by FundacionParaguaya.
the class SnapshotIndicatorPriorityEntity method setEstimatedDateAsISOString.
@Transient
public SnapshotIndicatorPriorityEntity setEstimatedDateAsISOString(String date) {
if (date != null) {
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy");
this.setEstimatedDate(LocalDate.parse(date, formatter));
}
return this;
}
use of javax.persistence.Transient in project Gemma by PavlidisLab.
the class PrincipalComponentAnalysis method getEigenvectorArrays.
/**
* @return Convenience method to access the eigenvectors, as a List of Double[].
*/
@Transient
public List<Double[]> getEigenvectorArrays() throws IllegalArgumentException {
ByteArrayConverter bac = new ByteArrayConverter();
List<Double[]> result = new ArrayList<>(this.getNumComponentsStored());
Collection<BioAssay> bioAssays = this.getBioAssayDimension().getBioAssays();
if (bioAssays.size() < this.getNumComponentsStored()) {
/*
* This is a sanity check. The number of components stored is fixed at some lower value
*/
throw new IllegalArgumentException("EE id = " + this.getExperimentAnalyzed().getId() + ", PCA: Number of components stored (" + this.getNumComponentsStored() + ") is less than the number of bioAssays (" + bioAssays.size() + ")");
}
for (int i = 0; i < bioAssays.size(); i++) {
result.add(null);
}
for (Eigenvector ev : this.getEigenVectors()) {
int index = ev.getComponentNumber() - 1;
if (index >= this.getNumComponentsStored())
continue;
double[] doubleArr = bac.byteArrayToDoubles(ev.getVector());
Double[] dA = ArrayUtils.toObject(doubleArr);
result.set(index, dA);
}
CollectionUtils.filter(result, new Predicate() {
@Override
public boolean evaluate(Object object) {
return object != null;
}
});
return result;
}
use of javax.persistence.Transient in project OpenClinica by OpenClinica.
the class AbstractAuditableMutableDomainObject method setUpdaterAndDate.
@Transient
public void setUpdaterAndDate(UserAccountBean updater) {
setUpdater(updater);
setUpdatedDate(new Date());
}
use of javax.persistence.Transient in project OpenClinica by OpenClinica.
the class RuleSetRuleBean method getAllActionsWithEvaluatesToAsKey.
@Transient
public HashMap<String, ArrayList<RuleActionBean>> getAllActionsWithEvaluatesToAsKey(String actionEvaluatesTo) {
HashMap<String, ArrayList<RuleActionBean>> h = new HashMap<String, ArrayList<RuleActionBean>>();
for (RuleActionBean action : actions) {
String key = action.getExpressionEvaluatesTo().toString();
if (actionEvaluatesTo == null || actionEvaluatesTo.equals(key)) {
if (h.containsKey(key)) {
h.get(key).add(action);
} else {
ArrayList<RuleActionBean> a = new ArrayList<RuleActionBean>();
a.add(action);
h.put(key, a);
}
}
}
return h;
}
use of javax.persistence.Transient in project hibernate-orm by hibernate.
the class JPAOverriddenAnnotationReader method initAnnotations.
/*
* The idea is to create annotation proxies for the xml configuration elements. Using this proxy annotations together
* with the {@link JPAMetadataProvider} allows to handle xml configuration the same way as annotation configuration.
*/
private void initAnnotations() {
if (annotations == null) {
XMLContext.Default defaults = xmlContext.getDefault(className);
if (className != null && propertyName == null) {
// is a class
Element tree = xmlContext.getXMLTree(className);
Annotation[] annotations = getPhysicalAnnotations();
List<Annotation> annotationList = new ArrayList<>(annotations.length + 5);
annotationsMap = new HashMap<>(annotations.length + 5);
for (Annotation annotation : annotations) {
if (!annotationToXml.containsKey(annotation.annotationType())) {
// unknown annotations are left over
annotationList.add(annotation);
}
}
addIfNotNull(annotationList, getEntity(tree, defaults));
addIfNotNull(annotationList, getMappedSuperclass(tree, defaults));
addIfNotNull(annotationList, getEmbeddable(tree, defaults));
addIfNotNull(annotationList, getTable(tree, defaults));
addIfNotNull(annotationList, getSecondaryTables(tree, defaults));
addIfNotNull(annotationList, getPrimaryKeyJoinColumns(tree, defaults, true));
addIfNotNull(annotationList, getIdClass(tree, defaults));
addIfNotNull(annotationList, getCacheable(tree, defaults));
addIfNotNull(annotationList, getInheritance(tree, defaults));
addIfNotNull(annotationList, getDiscriminatorValue(tree, defaults));
addIfNotNull(annotationList, getDiscriminatorColumn(tree, defaults));
addIfNotNull(annotationList, getSequenceGenerator(tree, defaults));
addIfNotNull(annotationList, getTableGenerator(tree, defaults));
addIfNotNull(annotationList, getNamedQueries(tree, defaults));
addIfNotNull(annotationList, getNamedNativeQueries(tree, defaults));
addIfNotNull(annotationList, getNamedStoredProcedureQueries(tree, defaults));
addIfNotNull(annotationList, getNamedEntityGraphs(tree, defaults));
addIfNotNull(annotationList, getSqlResultSetMappings(tree, defaults));
addIfNotNull(annotationList, getExcludeDefaultListeners(tree, defaults));
addIfNotNull(annotationList, getExcludeSuperclassListeners(tree, defaults));
addIfNotNull(annotationList, getAccessType(tree, defaults));
addIfNotNull(annotationList, getAttributeOverrides(tree, defaults, true));
addIfNotNull(annotationList, getAssociationOverrides(tree, defaults, true));
addIfNotNull(annotationList, getEntityListeners(tree, defaults));
addIfNotNull(annotationList, getConverts(tree, defaults));
this.annotations = annotationList.toArray(new Annotation[annotationList.size()]);
for (Annotation ann : this.annotations) {
annotationsMap.put(ann.annotationType(), ann);
}
checkForOrphanProperties(tree);
} else if (className != null) {
// && propertyName != null ) { //always true but less confusing
Element tree = xmlContext.getXMLTree(className);
Annotation[] annotations = getPhysicalAnnotations();
List<Annotation> annotationList = new ArrayList<>(annotations.length + 5);
annotationsMap = new HashMap<>(annotations.length + 5);
for (Annotation annotation : annotations) {
if (!annotationToXml.containsKey(annotation.annotationType())) {
// unknown annotations are left over
annotationList.add(annotation);
}
}
preCalculateElementsForProperty(tree);
Transient transientAnn = getTransient(defaults);
if (transientAnn != null) {
annotationList.add(transientAnn);
} else {
if (defaults.canUseJavaAnnotations()) {
Annotation annotation = getPhysicalAnnotation(Access.class);
addIfNotNull(annotationList, annotation);
}
getId(annotationList, defaults);
getEmbeddedId(annotationList, defaults);
getEmbedded(annotationList, defaults);
getBasic(annotationList, defaults);
getVersion(annotationList, defaults);
getAssociation(ManyToOne.class, annotationList, defaults);
getAssociation(OneToOne.class, annotationList, defaults);
getAssociation(OneToMany.class, annotationList, defaults);
getAssociation(ManyToMany.class, annotationList, defaults);
getAssociation(Any.class, annotationList, defaults);
getAssociation(ManyToAny.class, annotationList, defaults);
getElementCollection(annotationList, defaults);
addIfNotNull(annotationList, getSequenceGenerator(elementsForProperty, defaults));
addIfNotNull(annotationList, getTableGenerator(elementsForProperty, defaults));
addIfNotNull(annotationList, getConvertsForAttribute(elementsForProperty, defaults));
}
processEventAnnotations(annotationList, defaults);
// FIXME use annotationsMap rather than annotationList this will be faster since the annotation type is usually known at put() time
this.annotations = annotationList.toArray(new Annotation[annotationList.size()]);
for (Annotation ann : this.annotations) {
annotationsMap.put(ann.annotationType(), ann);
}
} else {
this.annotations = getPhysicalAnnotations();
annotationsMap = new HashMap<>(annotations.length + 5);
for (Annotation ann : this.annotations) {
annotationsMap.put(ann.annotationType(), ann);
}
}
}
}
Aggregations