use of javax.persistence.Transient in project OpenClinica by OpenClinica.
the class RuleSetRuleBean method getActionsAsKeyPair.
@Transient
public HashMap<String, ArrayList<String>> getActionsAsKeyPair(String actionEvaluatesTo) {
HashMap<String, ArrayList<String>> h = new HashMap<String, ArrayList<String>>();
for (RuleActionBean action : actions) {
String key = action.getExpressionEvaluatesTo().toString();
if (actionEvaluatesTo.equals(key)) {
if (h.containsKey(key)) {
h.get(key).add(action.getSummary());
} else {
ArrayList<String> a = new ArrayList<String>();
a.add(action.getSummary());
h.put(key, a);
}
}
}
return h;
}
use of javax.persistence.Transient in project eweb4j-framework by laiweiwei.
the class PojoAnnotationConfig method getProperties.
private static List<Property> getProperties(Class<?> clazz, final List<Property> pList, final boolean requireSuper, Log log) throws Throwable {
List<Property> result = new ArrayList<Property>();
ReflectUtil ru;
try {
ru = new ReflectUtil(clazz);
ru.setRequiredSuper(requireSuper);
} catch (Throwable e) {
log.warn(e.toString(), e);
throw e;
}
for (Field f : ru.getFields()) {
if (Collection.class.isAssignableFrom(f.getType()))
continue;
String name = f.getName();
Method getter = ru.getGetter(name);
if (getter == null)
continue;
Ignore igAnn = f.getAnnotation(Ignore.class);
if (igAnn == null)
igAnn = getter.getAnnotation(Ignore.class);
if (igAnn != null)
continue;
Transient trans = f.getAnnotation(Transient.class);
if (trans == null)
trans = getter.getAnnotation(Transient.class);
if (trans != null)
continue;
OneToMany manyAnn = getter.getAnnotation(OneToMany.class);
if (manyAnn != null)
continue;
else {
manyAnn = f.getAnnotation(OneToMany.class);
if (manyAnn != null)
continue;
}
ManyToMany manyManyAnn = getter.getAnnotation(ManyToMany.class);
if (manyManyAnn != null)
continue;
else {
manyManyAnn = f.getAnnotation(ManyToMany.class);
if (manyManyAnn != null)
continue;
}
Property p = new Property();
if (Long.class.isAssignableFrom(f.getType()) || long.class.isAssignableFrom(f.getType()))
p.setSize("20");
else if (Integer.class.isAssignableFrom(f.getType()) || int.class.isAssignableFrom(f.getType()))
p.setSize("8");
else if (String.class.isAssignableFrom(f.getType()))
p.setSize("255");
else if (Boolean.class.isAssignableFrom(f.getType()) || boolean.class.isAssignableFrom(f.getType()))
p.setSize("");
else if (Float.class.isAssignableFrom(f.getType()) || float.class.isAssignableFrom(f.getType()))
p.setSize("8");
Id idAnn = getter.getAnnotation(Id.class);
if (idAnn == null)
idAnn = f.getAnnotation(Id.class);
if (idAnn != null) {
if (pList != null && hasIdProperty(pList))
continue;
p.setAutoIncrement("1");
p.setPk("1");
p.setSize("20");
}
Column colAnn = getter.getAnnotation(Column.class);
if (colAnn == null) {
colAnn = f.getAnnotation(Column.class);
}
String column = colAnn == null ? "" : colAnn.name();
column = "".equals(column.trim()) ? name : column;
p.setName(name);
p.setColumn(column);
p.setType(f.getType().getName());
p.setNotNull("false");
if (colAnn != null) {
// int size = colAnn.length();
p.setNotNull(String.valueOf(!colAnn.nullable()));
p.setUnique(String.valueOf(colAnn.unique()));
}
if (ClassUtil.isPojo(f.getType())) {
OneToOne oneAnn = getter.getAnnotation(OneToOne.class);
if (oneAnn == null)
oneAnn = f.getAnnotation(OneToOne.class);
ManyToOne manyToOneAnn = null;
if (oneAnn == null) {
manyToOneAnn = getter.getAnnotation(ManyToOne.class);
if (manyToOneAnn == null)
manyToOneAnn = f.getAnnotation(ManyToOne.class);
}
if (oneAnn != null || manyToOneAnn != null) {
if (oneAnn != null)
p.setType(PropType.ONE_ONE);
else
p.setType(PropType.MANY_ONE);
JoinColumn joinColumn = getter.getAnnotation(JoinColumn.class);
if (joinColumn == null)
joinColumn = f.getAnnotation(JoinColumn.class);
if (joinColumn != null && joinColumn.name().trim().length() > 0)
p.setColumn(joinColumn.name());
else
p.setColumn(f.getName() + "_id");
p.setRelProperty(null);
String refCol = null;
if (joinColumn != null && joinColumn.referencedColumnName().trim().length() > 0) {
refCol = joinColumn.referencedColumnName();
if (refCol != null && refCol.trim().length() > 0) {
String relField = ORMConfigBeanUtil.getField(f.getType(), refCol);
if (relField != null && relField.trim().length() > 0)
p.setRelProperty(relField);
}
}
p.setRelClass(f.getType());
p.setSize("20");
}
}
result.add(p);
}
return result;
}
use of javax.persistence.Transient in project head by mifos.
the class RESTApprovalEntity method setApprovalMethod.
@Transient
public void setApprovalMethod(ApprovalMethod method) throws Exception {
approvalMethod = method;
ObjectMapper om = new ObjectMapper();
String content = om.writeValueAsString(method);
setMethodContent(content);
}
use of javax.persistence.Transient in project opennms by OpenNMS.
the class BridgeMacLink method printTopology.
@Transient
public String printTopology() {
final StringBuilder strbfr = new StringBuilder();
strbfr.append("mac link:[");
strbfr.append(getMacAddress());
strbfr.append(", bridge:[");
strbfr.append(getNode().getId());
strbfr.append("], bridgeport:");
strbfr.append(getBridgePort());
if (getBridgeDot1qTpFdbStatus() != null) {
strbfr.append(", status:");
strbfr.append(BridgeDot1qTpFdbStatus.getTypeString(getBridgeDot1qTpFdbStatus().getValue()));
}
strbfr.append(", ifindex:");
strbfr.append(getBridgePortIfIndex());
strbfr.append("]\n");
return strbfr.toString();
}
use of javax.persistence.Transient in project ORCID-Source by ORCID.
the class ProfileEntity method getCacheKey.
/**
* Generates a string that will be used for caching proposes
*
* @param profile
* @return a string containing the orcid id and the last modified day,
* concatenated by '_'
*/
@Transient
public String getCacheKey() {
String orcid = this.getId();
Date lastModified = this.getLastModified() == null ? new Date() : this.getLastModified();
String lastModifiedString = DateUtils.convertToXMLGregorianCalendar(lastModified).toXMLFormat();
return StringUtils.join(new String[] { orcid, lastModifiedString }, "_");
}
Aggregations