NonRelationshipAccessorpublic abstract class NonRelationshipAccessor extends MetadataAccessor
Methods Summary |
---|
protected void | processSequenceGenerator()INTERNAL: (Overridden in XMLClassAccessor and XMLBasicAccessor)
Process a @SequenceGenerator into a common metadata sequence generator.
SequenceGenerator sequenceGenerator = getAnnotation(SequenceGenerator.class);
if (sequenceGenerator != null) {
// Ask the common processor to process what we found.
processSequenceGenerator(new MetadataSequenceGenerator(sequenceGenerator, getJavaClassName()));
}
| protected void | processSequenceGenerator(oracle.toplink.essentials.internal.ejb.cmp3.metadata.sequencing.MetadataSequenceGenerator sequenceGenerator)INTERNAL:
Process a MetadataSequenceGenerator and add it to the project.
// Check if the sequence generator name uses a reserved name.
String name = sequenceGenerator.getName();
if (name.equals(MetadataConstants.DEFAULT_TABLE_GENERATOR)) {
m_validator.throwSequenceGeneratorUsingAReservedName(MetadataConstants.DEFAULT_TABLE_GENERATOR, sequenceGenerator.getLocation());
}
// Conflicting means that they do not have all the same values.
if (m_project.hasConflictingSequenceGenerator(sequenceGenerator)) {
MetadataSequenceGenerator otherSequenceGenerator = m_project.getSequenceGenerator(name);
if (sequenceGenerator.loadedFromAnnotations() && otherSequenceGenerator.loadedFromXML()) {
// WIP - should log a warning that we are ignoring this table generator.
return;
} else {
m_validator.throwConflictingSequenceGeneratorsSpecified(name, sequenceGenerator.getLocation(), otherSequenceGenerator.getLocation());
}
}
if (m_project.hasTableGenerator(name)) {
MetadataTableGenerator otherTableGenerator = m_project.getTableGenerator(name);
m_validator.throwConflictingSequenceAndTableGeneratorsSpecified(name, sequenceGenerator.getLocation(), otherTableGenerator.getLocation());
}
for (MetadataTableGenerator otherTableGenerator : m_project.getTableGenerators()) {
if (otherTableGenerator.getPkColumnValue().equals(sequenceGenerator.getSequenceName())) {
// generator name will be used instead of an empty sequence name / pk column name
if(otherTableGenerator.getPkColumnValue().length() > 0) {
m_validator.throwConflictingSequenceNameAndTablePkColumnValueSpecified(sequenceGenerator.getSequenceName(), sequenceGenerator.getLocation(), otherTableGenerator.getLocation());
}
}
}
m_project.addSequenceGenerator(sequenceGenerator);
| protected void | processTableGenerator()INTERNAL: (Overridden in XMLClassAccessor and XMLBasicAccessor)
Process a @TableGenerator into a common metadata table generator.
TableGenerator tableGenerator = getAnnotation(TableGenerator.class);
if (tableGenerator != null) {
// Ask the common processor to process what we found.
processTableGenerator(new MetadataTableGenerator(tableGenerator, getJavaClassName()));
}
| protected void | processTableGenerator(oracle.toplink.essentials.internal.ejb.cmp3.metadata.sequencing.MetadataTableGenerator tableGenerator)INTERNAL:
Process a MetadataTableGenerator and add it to the project.
// Check if the table generator name uses a reserved name.
String name = tableGenerator.getName();
if (name.equals(MetadataConstants.DEFAULT_SEQUENCE_GENERATOR)) {
m_validator.throwTableGeneratorUsingAReservedName(MetadataConstants.DEFAULT_SEQUENCE_GENERATOR, tableGenerator.getLocation());
}
// Conflicting means that they do not have all the same values.
if (m_project.hasConflictingTableGenerator(tableGenerator)) {
MetadataTableGenerator otherTableGenerator = m_project.getTableGenerator(name);
if (tableGenerator.loadedFromAnnotations() && otherTableGenerator.loadedFromXML()) {
// WIP - should log a warning that we are ignoring this table generator.
return;
} else {
m_validator.throwConflictingTableGeneratorsSpecified(name, tableGenerator.getLocation(), otherTableGenerator.getLocation());
}
}
if (m_project.hasSequenceGenerator(tableGenerator.getName())) {
MetadataSequenceGenerator otherSequenceGenerator = m_project.getSequenceGenerator(name);
m_validator.throwConflictingSequenceAndTableGeneratorsSpecified(name, otherSequenceGenerator.getLocation(), tableGenerator.getLocation());
}
for (MetadataSequenceGenerator otherSequenceGenerator : m_project.getSequenceGenerators()) {
if (otherSequenceGenerator.getSequenceName().equals(tableGenerator.getPkColumnValue())) {
// generator name will be used instead of an empty sequence name / pk column name
if(otherSequenceGenerator.getSequenceName().length() > 0) {
m_validator.throwConflictingSequenceNameAndTablePkColumnValueSpecified(otherSequenceGenerator.getSequenceName(), otherSequenceGenerator.getLocation(), tableGenerator.getLocation());
}
}
}
// Add the table generator to the descriptor metadata.
m_project.addTableGenerator(tableGenerator);
|
|