// (getters/setters)
for (Method m : c.getMethods()) {
if (!isRelevantAttribute(m, c)) {
continue;
}
SpeedoField sf = new SpeedoField();
sf.name = getter2attribute(m.getName());
// sf.visibility;
sf.moClass = sc;
sc.fields.put(sf.name, sf);
logger.log(BasicLevel.DEBUG, "New SpeedoField for EJB property: "
+ sf.name + ", TYPE: " + sf.type);
parseManyToOne(m.getAnnotation(ManyToOne.class), sc, sf);
parseOneToOne(m.getAnnotation(OneToOne.class), sc, sf);
parseOneToMany(m.getAnnotation(OneToMany.class), sc, sf);
parseManyToMany(m.getAnnotation(ManyToMany.class), sc, sf);
parseType((Class) m.getReturnType(), m.getGenericReturnType(), sc,
sf);
if (sf.relationType == SpeedoField.NO_BI_RELATION) {
excludeAnnotation(new Object[] {
m.getAnnotation(JoinColumns.class),
m.getAnnotation(JoinColumn.class),
m.getAnnotation(JoinTable.class) }, sc, sf.name,
"property");
parseVersion(m.getAnnotation(Version.class), sc, sf);
parseColumn(m.getAnnotation(Column.class), sc, sf);
parseBasic(m.getAnnotation(Basic.class), sc, sf, true);
parseLob(m.getAnnotation(Lob.class), sc, sf, true);
if (m.getAnnotation(Embedded.class) != null) {
parseEmbeddedOverriding(
(AttributeOverride) m.getAnnotation(AttributeOverride.class),
(AttributeOverrides) m.getAnnotation(AttributeOverrides.class),
sc, sf);
}
} else {
excludeAnnotation(new Object[] {
m.getAnnotation(Version.class),
m.getAnnotation(Column.class),
m.getAnnotation(Basic.class),
m.getAnnotation(Lob.class) }, sc, sf.name,
"association property");
if (m.getAnnotation(JoinColumns.class) != null) {
if (m.getAnnotation(JoinColumn.class) != null) {
nbErrors++;
logger.log(BasicLevel.ERROR, sc.getSourceDescShort()
+ ": cannot define both 'JoinColumns' and'JoinColumn' annotation for property ("
+ sf.name + ").");
} else {
parseJoinColumns(
m.getAnnotation(JoinColumns.class).value(),
sc, sf);
}
} else {
if (m.getAnnotation(JoinColumn.class) != null) {
parseJoinColumns(
new JoinColumn[] { m.getAnnotation(JoinColumn.class) },
sc, sf);
}
}
}
parseEmbeddedId(m.getAnnotation(EmbeddedId.class), sc, sf);
if (parseId(m.getAnnotation(Id.class), sc, sf)) {
// ---------------------------------------------------------------------
// In case of Long identifier, try parsing Id generator
parseGeneratedValue((GeneratedValue) m.getAnnotation(GeneratedValue.class), sc);
} else {
if (m.getAnnotation(GeneratedValue.class) != null) {
logger.log(BasicLevel.WARN, sc.getSourceDescShort()
+ ": can only associate an identifier generator to a Long ID - ignored!");
}
}
}
// look for persistent attributes represented by variables
for (Field f : c.getDeclaredFields()) {
if (!isRelevantAttribute(f, c)) {
continue;
}
SpeedoField sf = new SpeedoField();
sf.name = f.getName();
// sf.visibility;
sf.moClass = sc;
sc.fields.put(sf.name, sf);
logger.log(BasicLevel.DEBUG, "New SpeedoField for EJB field: "