Author: adamw
Date: 2008-09-21 08:21:25 -0400 (Sun, 21 Sep 2008)
New Revision: 152
Modified:
trunk/src/main/org/jboss/envers/configuration/metadata/CollectionMetadataGenerator.java
trunk/src/main/org/jboss/envers/configuration/metadata/ToOneRelationMetadataGenerator.java
trunk/src/main/org/jboss/envers/entities/EntitiesConfigurations.java
trunk/src/main/org/jboss/envers/entities/EntityConfiguration.java
trunk/src/main/org/jboss/envers/entities/RelationType.java
trunk/src/main/org/jboss/envers/entities/mapper/relation/component/MiddleDummyComponentMapper.java
trunk/src/main/org/jboss/envers/entities/mapper/relation/component/MiddleRelatedComponentMapper.java
trunk/src/main/org/jboss/envers/entities/mapper/relation/component/MiddleSimpleComponentMapper.java
trunk/src/main/org/jboss/envers/event/VersionsEventListener.java
trunk/src/test/org/jboss/envers/test/integration/naming/OneToManyUnidirectionalNaming.java
Log:
ENVERS-42, ENVERS-44: many-to-many relations support working again
Modified:
trunk/src/main/org/jboss/envers/configuration/metadata/CollectionMetadataGenerator.java
===================================================================
---
trunk/src/main/org/jboss/envers/configuration/metadata/CollectionMetadataGenerator.java 2008-09-19
14:51:22 UTC (rev 151)
+++
trunk/src/main/org/jboss/envers/configuration/metadata/CollectionMetadataGenerator.java 2008-09-21
12:21:25 UTC (rev 152)
@@ -28,7 +28,7 @@
* Generates metadata for collection-valued properties.
* @author Adam Warski (adam at warski dot org)
*/
-public final class CollectionMetadataGenerator {
+public final class CollectionMetadataGenerator {
private final VersionsMetadataGenerator mainGenerator;
CollectionMetadataGenerator(VersionsMetadataGenerator versionsMetadataGenerator) {
@@ -102,7 +102,7 @@
IdMapper ownedIdMapper =
referencingIdMapping.getIdMapper().prefixMappedProperties(lastPropertyPrefix);
// Storing information about this relation
-
mainGenerator.getEntitiesConfigurations().get(entityName).addOneToManyAttachedRelation(name,
owningReferencePropertyName,
+
mainGenerator.getEntitiesConfigurations().get(entityName).addToManyNotOwningRelation(name,
owningReferencePropertyName,
owningEntityName, ownedIdMapper);
// Adding mapper for the id
@@ -119,6 +119,15 @@
}
@SuppressWarnings({"unchecked"})
+ private void addRelatedToXmlMapping(Element xmlMapping, String prefix, Value
relatedValue, IdMappingData relatedIdMapping) {
+ Element properties = (Element) relatedIdMapping.getXmlRelationMapping().clone();
+ MetadataTools.prefixNamesInPropertyElement(properties, prefix,
relatedValue.getColumnIterator(), true);
+ for (Element idProperty : (java.util.List<Element>) properties.elements())
{
+ xmlMapping.add((Element) idProperty.clone());
+ }
+ }
+
+ @SuppressWarnings({"unchecked"})
private void addWithMiddleTable(String name, Collection value, CompositeMapperBuilder
currentMapper,
String entityName, EntityXmlMappingData
xmlMappingData) {
// Generating the name of the middle table, its schema and catalog
@@ -135,16 +144,13 @@
// If the relation is inverse, will be later checked by comparing middleEntityXml
with null.
Element middleEntityXml;
Element middleEntityXmlId;
- Iterator<Column> middleEntityOriginalColumns;
if (!value.isInverse()) {
middleEntityXml =
MetadataTools.createEntity(xmlMappingData.newAdditionalMapping(),
versionsMiddleEntityName, versionsMiddleTableName, schema, catalog,
null);
middleEntityXmlId = middleEntityXml.addElement("composite-id");
- middleEntityOriginalColumns =
value.getCollectionTable().getColumnIterator();
} else {
middleEntityXml = null;
middleEntityXmlId = null;
- middleEntityOriginalColumns = null;
}
// ******
@@ -200,11 +206,8 @@
if (middleEntityXml != null) {
middleEntityXmlId.addAttribute("name",
mainGenerator.getVerEntCfg().getOriginalIdPropName());
- Element properties = (Element)
referencingIdMapping.getXmlRelationMapping().clone();
- MetadataTools.prefixNamesInPropertyElement(properties, referencingPrefix,
middleEntityOriginalColumns, true);
- for (Element idProperty : (java.util.List<Element>)
properties.elements()) {
- middleEntityXmlId.add((Element) idProperty.clone());
- }
+ // Adding related-entity (in this case: the referencing's entity id) id
mapping to the xml.
+ addRelatedToXmlMapping(middleEntityXmlId, referencingPrefix, value.getKey(),
referencingIdMapping);
// Adding the revision number as a foreign key to the revision info entity to
the composite id of the
// middle table.
@@ -218,7 +221,7 @@
// Generating the element mapping.
// ******
MiddleComponentData elementComponentData =
addValueToMiddleTable(value.getElement(), middleEntityXmlId,
- middleEntityOriginalColumns, queryGeneratorBuilder, referencedPrefix);
+ queryGeneratorBuilder, referencedPrefix);
// ******
// Optionally, generating the index mapping.
@@ -254,6 +257,17 @@
} else {
throw new RuntimeException();
}
+
+ // ******
+ // Storing information about this relation.
+ // ******
+ if (value.isInverse()) {
+
mainGenerator.getEntitiesConfigurations().get(entityName).addToManyMiddleNotOwningRelation(name,
mappedBy,
+ referencedEntityName);
+ } else {
+
mainGenerator.getEntitiesConfigurations().get(entityName).addToManyMiddleRelation(name,
+ referencedEntityName);
+ }
}
/**
@@ -261,15 +275,12 @@
* @param value Value, which should be mapped to the middle-table, either as a
relation to another entity,
* or as a simple value.
* @param middleEntityXml If not <code>null</code>, xml mapping for this
value is added to this element.
- * @param middleEntityOriginalColumns If <code>middleEntityXml</code> is
not null, this iterator is used
- * to read column names for the generated xml mapping.
* @param queryGeneratorBuilder In case <code>value</code> is a relation
to another entity, information about it
* should be added to the given.
* @param prefix Prefix for proeprty names of related entities identifiers.
* @return Data for mapping this component.
*/
private MiddleComponentData addValueToMiddleTable(Value value, Element
middleEntityXml,
- Iterator<Column>
middleEntityOriginalColumns,
QueryGeneratorBuilder
queryGeneratorBuilder,
String prefix) {
Type type = value.getType();
@@ -279,6 +290,12 @@
IdMappingData referencedIdMapping =
mainGenerator.getEntitiesConfigurations().get(
toOneValue.getReferencedEntityName()).getIdMappingData();
+ // Adding related-entity (in this case: the referenced entities id) id
mapping to the xml only if the
+ // relation isn't inverse (so when
<code>middleEntityXml</code> is not null).
+ if (middleEntityXml != null) {
+ addRelatedToXmlMapping(middleEntityXml, prefix, value,
referencedIdMapping);
+ }
+
// Storing the id data of the referenced entity: original mapper, prefixed
mapper and entity name.
IdMapper referencedPrefixedIdMapper =
referencedIdMapping.getIdMapper().prefixMappedProperties(prefix);
MiddleIdData referencedIdData = new MiddleIdData(
@@ -302,114 +319,4 @@
throw new RuntimeException();
}
}
-
- private String getMiddleEntityName(String entityName, String referencedEntityName,
ManyToOne mto) {
- return entityName + "_" + referencedEntityName + "_" +
mto.getTable().getName();
- }
-
- @SuppressWarnings({"unchecked"})
- private void addOneToManyDetached(String name, Collection value,
CompositeMapperBuilder mapper, String entityName,
- EntityXmlMappingData xmlMappingData) {
- ManyToOne mto = (ManyToOne) value.getElement();
-
- String referencedEntityName = mto.getReferencedEntityName();
-
- EntityConfiguration configuration =
mainGenerator.getEntitiesConfigurations().get(entityName);
- if (configuration == null) {
- throw new MappingException("A versioned relation to a non-versioned
entity " + entityName + "!");
- }
-
- EntityConfiguration referencedConfiguration =
mainGenerator.getEntitiesConfigurations().get(referencedEntityName);
- if (referencedConfiguration == null) {
- throw new MappingException("A versioned relation to a non-versioned
entity " + referencedEntityName + "!");
- }
-
- IdMappingData referencingIdMapping = configuration.getIdMappingData();
- IdMappingData referencedIdMapping = referencedConfiguration.getIdMappingData();
-
- String referencingPrefix = StringTools.getLastComponent(entityName) +
"_";
- String referencedPrefix = name + "_";
-
- // Name of the entity that will be used to store the relation between the two
entities.
- String middleEntityName = getMiddleEntityName(entityName, referencedEntityName,
mto);
- String versionsMiddleEntityName =
mainGenerator.getVerEntCfg().getVersionsEntityName(middleEntityName);
- String versionsMiddleTableName =
mainGenerator.getVerEntCfg().getVersionsTableName(middleEntityName,
mto.getTable().getName());
-
- Element middleEntity =
MetadataTools.createEntity(xmlMappingData.newAdditionalMapping(),
versionsMiddleEntityName,
- versionsMiddleTableName, mto.getTable().getSchema(),
mto.getTable().getCatalog(), null);
-
- Element middleEntityId = middleEntity.addElement("composite-id");
- middleEntityId.addAttribute("name",
mainGenerator.getVerEntCfg().getOriginalIdPropName());
-
- Iterator columnIterator = mto.getTable().getColumnIterator();
-
- // Adding elements to the mapping corresponding to the referencing entity
id's
- Element properties = (Element)
referencingIdMapping.getXmlRelationMapping().clone();
- MetadataTools.prefixNamesInPropertyElement(properties, referencingPrefix,
columnIterator, true);
- for (Element idProperty : (java.util.List<Element>) properties.elements())
{
- middleEntityId.add((Element) idProperty.clone());
- }
-
- // Adding elements to the mapping corresponding to the referenced entity
id's
- properties = (Element) referencedIdMapping.getXmlRelationMapping().clone();
- MetadataTools.prefixNamesInPropertyElement(properties, referencedPrefix,
columnIterator, true);
- for (Element idProperty : (java.util.List<Element>) properties.elements())
{
- middleEntityId.add((Element) idProperty.clone());
- }
-
- mainGenerator.addRevisionInfoRelation(middleEntityId);
- mainGenerator.addRevisionType(middleEntity);
-
-
mainGenerator.getEntitiesConfigurations().get(entityName).addOneToManyDetachedRelation(name,
referencedEntityName);
-
- // Adding the property mapper
- mapper.addComposite(name, new
OneToManyDetachedMapper(mainGenerator.getVerEntCfg(), entityName,
- referencedEntityName, name,
mainGenerator.getVerEntCfg().getVersionsEntityName(referencedEntityName),
- versionsMiddleEntityName,
referencingIdMapping.getIdMapper().prefixMappedProperties(referencingPrefix),
-
referencedIdMapping.getIdMapper().prefixMappedProperties(referencedPrefix),
-
mainGenerator.getEntitiesConfigurations().get(referencedEntityName).getIdMapper()));
- }
-
- private void addManyToManyNotOwning(String name, Collection value,
CompositeMapperBuilder mapper, String entityName) {
- ManyToOne mto = (ManyToOne) value.getElement();
-
- String referencedEntityName = mto.getReferencedEntityName();
-
- EntityConfiguration configuration =
mainGenerator.getEntitiesConfigurations().get(entityName);
- if (configuration == null) {
- throw new MappingException("A versioned relation to a non-versioned
entity " + entityName + "!");
- }
-
- EntityConfiguration referencedConfiguration =
mainGenerator.getEntitiesConfigurations().get(referencedEntityName);
- if (referencedConfiguration == null) {
- throw new MappingException("A versioned relation to a non-versioned
entity " + referencedEntityName + "!");
- }
-
- String mappedBy = getMappedBy(value.getCollectionTable(),
mainGenerator.getCfg().getClassMapping(referencedEntityName));
- if (mappedBy == null) {
- throw new MappingException("Unable to read the mapped by attribute for
" + name);
- }
-
- IdMappingData referencingIdMapping = configuration.getIdMappingData();
- IdMappingData referencedIdMapping = referencedConfiguration.getIdMappingData();
-
- String referencingPrefix = mappedBy + "_";
- String referencedPrefix = StringTools.getLastComponent(referencedEntityName) +
"_";
-
- // Name of the entity that will be used to store the relation between the two
entities.
- // The order is inverse, as the referenced and referencing entity names are
swapped with respect to the
- // name of the entity that was created on the owning side in
<code>addOneToManyDetached</code>.
- String middleEntityName = getMiddleEntityName(referencedEntityName, entityName,
mto);
- String versionsMiddleEntityName =
mainGenerator.getVerEntCfg().getVersionsEntityName(middleEntityName);
-
-
mainGenerator.getEntitiesConfigurations().get(entityName).addManyToManyNotOwningRelation(name,
mappedBy,
- referencedEntityName);
-
- // Adding the property mapper
- mapper.addComposite(name, new
ManyToManyNotOwningMapper(mainGenerator.getVerEntCfg(), entityName,
- referencedEntityName, name,
mainGenerator.getVerEntCfg().getVersionsEntityName(referencedEntityName),
- versionsMiddleEntityName,
referencingIdMapping.getIdMapper().prefixMappedProperties(referencingPrefix),
-
referencedIdMapping.getIdMapper().prefixMappedProperties(referencedPrefix),
-
mainGenerator.getEntitiesConfigurations().get(referencedEntityName).getIdMapper()));
- }
}
Modified:
trunk/src/main/org/jboss/envers/configuration/metadata/ToOneRelationMetadataGenerator.java
===================================================================
---
trunk/src/main/org/jboss/envers/configuration/metadata/ToOneRelationMetadataGenerator.java 2008-09-19
14:51:22 UTC (rev 151)
+++
trunk/src/main/org/jboss/envers/configuration/metadata/ToOneRelationMetadataGenerator.java 2008-09-21
12:21:25 UTC (rev 152)
@@ -77,7 +77,7 @@
IdMapper ownedIdMapper =
ownedIdMapping.getIdMapper().prefixMappedProperties(lastPropertyPrefix);
// Storing information about this relation
-
mainGenerator.getEntitiesConfigurations().get(entityName).addOneToOneNotOwningRelation(name,
owningReferencePropertyName,
+
mainGenerator.getEntitiesConfigurations().get(entityName).addToOneNotOwningRelation(name,
owningReferencePropertyName,
referencedEntityName, ownedIdMapper);
// Adding mapper for the id
Modified: trunk/src/main/org/jboss/envers/entities/EntitiesConfigurations.java
===================================================================
--- trunk/src/main/org/jboss/envers/entities/EntitiesConfigurations.java 2008-09-19
14:51:22 UTC (rev 151)
+++ trunk/src/main/org/jboss/envers/entities/EntitiesConfigurations.java 2008-09-21
12:21:25 UTC (rev 152)
@@ -59,7 +59,7 @@
// If this is an "owned" relation, checking the related entity,
if it has a relation that has
// a mapped-by attribute to the currently checked. If so, this is a
bidirectional relation.
if (relDesc.getRelationType() == RelationType.TO_ONE ||
- relDesc.getRelationType() == RelationType.ONE_TO_MANY_DETACHED)
{
+ relDesc.getRelationType() == RelationType.TO_MANY_MIDDLE) {
for (RelationDescription other :
entitiesConfigurations.get(relDesc.getToEntityName()).getRelationsIterator()) {
if
(relDesc.getFromPropertyName().equals(other.getMappedByPropertyName()) &&
(entityName.equals(other.getToEntityName()))) {
Modified: trunk/src/main/org/jboss/envers/entities/EntityConfiguration.java
===================================================================
--- trunk/src/main/org/jboss/envers/entities/EntityConfiguration.java 2008-09-19 14:51:22
UTC (rev 151)
+++ trunk/src/main/org/jboss/envers/entities/EntityConfiguration.java 2008-09-21 12:21:25
UTC (rev 152)
@@ -55,26 +55,25 @@
toEntityName, null, idMapper));
}
- public void addOneToOneNotOwningRelation(String fromPropertyName, String
mappedByPropertyName, String toEntityName,
+ public void addToOneNotOwningRelation(String fromPropertyName, String
mappedByPropertyName, String toEntityName,
IdMapper idMapper) {
- relations.put(fromPropertyName, new RelationDescription(fromPropertyName,
RelationType.ONE_TO_ONE,
+ relations.put(fromPropertyName, new RelationDescription(fromPropertyName,
RelationType.TO_ONE_NOT_OWNING,
toEntityName, mappedByPropertyName, idMapper));
}
- public void addOneToManyAttachedRelation(String fromPropertyName, String
mappedByPropertyName, String toEntityName,
+ public void addToManyNotOwningRelation(String fromPropertyName, String
mappedByPropertyName, String toEntityName,
IdMapper idMapper) {
- relations.put(fromPropertyName, new RelationDescription(fromPropertyName,
RelationType.ONE_TO_MANY,
+ relations.put(fromPropertyName, new RelationDescription(fromPropertyName,
RelationType.TO_MANY_NOT_OWNING,
toEntityName, mappedByPropertyName, idMapper));
}
- public void addOneToManyDetachedRelation(String fromPropertyName, String
toEntityName) {
- relations.put(fromPropertyName, new RelationDescription(fromPropertyName,
RelationType.ONE_TO_MANY_DETACHED,
+ public void addToManyMiddleRelation(String fromPropertyName, String toEntityName) {
+ relations.put(fromPropertyName, new RelationDescription(fromPropertyName,
RelationType.TO_MANY_MIDDLE,
toEntityName, null, null));
}
- public void addManyToManyNotOwningRelation(String fromPropertyName, String
mappedByPropertyName,
- String toEntityName) {
- relations.put(fromPropertyName, new RelationDescription(fromPropertyName,
RelationType.MANY_TO_MANY_NOT_OWNING,
+ public void addToManyMiddleNotOwningRelation(String fromPropertyName, String
mappedByPropertyName, String toEntityName) {
+ relations.put(fromPropertyName, new RelationDescription(fromPropertyName,
RelationType.TO_MANY_MIDDLE_NOT_OWNING,
toEntityName, mappedByPropertyName, null));
}
Modified: trunk/src/main/org/jboss/envers/entities/RelationType.java
===================================================================
--- trunk/src/main/org/jboss/envers/entities/RelationType.java 2008-09-19 14:51:22 UTC
(rev 151)
+++ trunk/src/main/org/jboss/envers/entities/RelationType.java 2008-09-21 12:21:25 UTC
(rev 152)
@@ -24,12 +24,31 @@
package org.jboss.envers.entities;
/**
+ * Type of a relation between two entities.
* @author Adam Warski (adam at warski dot org)
*/
public enum RelationType {
+ /**
+ * A single-reference-valued relation. The entity owns the relation.
+ */
TO_ONE,
- ONE_TO_ONE,
- ONE_TO_MANY,
- ONE_TO_MANY_DETACHED,
- MANY_TO_MANY_NOT_OWNING
+ /**
+ * A single-reference-valued relation. The entity doesn't own the relation. It is
directly mapped in the related
+ * entity.
+ */
+ TO_ONE_NOT_OWNING,
+ /**
+ * A collection-of-references-valued relation. The entity doesn't own the
relation. It is directly mapped in the
+ * related entity.
+ */
+ TO_MANY_NOT_OWNING,
+ /**
+ * A collection-of-references-valued relation. The entity owns the relation. It is
mapped using a middle table.
+ */
+ TO_MANY_MIDDLE,
+ /**
+ * A collection-of-references-valued relation. The entity doesn't own the
relation. It is mapped using a middle
+ * table.
+ */
+ TO_MANY_MIDDLE_NOT_OWNING
}
Modified:
trunk/src/main/org/jboss/envers/entities/mapper/relation/component/MiddleDummyComponentMapper.java
===================================================================
---
trunk/src/main/org/jboss/envers/entities/mapper/relation/component/MiddleDummyComponentMapper.java 2008-09-19
14:51:22 UTC (rev 151)
+++
trunk/src/main/org/jboss/envers/entities/mapper/relation/component/MiddleDummyComponentMapper.java 2008-09-21
12:21:25 UTC (rev 152)
@@ -1,12 +1,12 @@
package org.jboss.envers.entities.mapper.relation.component;
import org.jboss.envers.entities.EntityInstantiator;
-import org.jboss.envers.entities.mapper.relation.component.MiddleComponentMapper;
import java.util.Map;
/**
* @author Adam Warski (adam at warski dot org)
+ * @deprecated
*/
public final class MiddleDummyComponentMapper implements MiddleComponentMapper {
public Object mapToObjectFromFullMap(EntityInstantiator entityInstantiator,
Map<String, Object> data, Number revision) {
Modified:
trunk/src/main/org/jboss/envers/entities/mapper/relation/component/MiddleRelatedComponentMapper.java
===================================================================
---
trunk/src/main/org/jboss/envers/entities/mapper/relation/component/MiddleRelatedComponentMapper.java 2008-09-19
14:51:22 UTC (rev 151)
+++
trunk/src/main/org/jboss/envers/entities/mapper/relation/component/MiddleRelatedComponentMapper.java 2008-09-21
12:21:25 UTC (rev 152)
@@ -1,7 +1,6 @@
package org.jboss.envers.entities.mapper.relation.component;
import org.jboss.envers.entities.EntityInstantiator;
-import org.jboss.envers.entities.mapper.relation.component.MiddleComponentMapper;
import org.jboss.envers.entities.mapper.relation.MiddleIdData;
import java.util.Map;
@@ -22,6 +21,6 @@
}
public void mapToMapFromObject(Map<String, Object> data, Object obj) {
- relatedIdData.getOriginalMapper().mapToMapFromEntity(data, obj);
+ relatedIdData.getPrefixedMapper().mapToMapFromEntity(data, obj);
}
}
Modified:
trunk/src/main/org/jboss/envers/entities/mapper/relation/component/MiddleSimpleComponentMapper.java
===================================================================
---
trunk/src/main/org/jboss/envers/entities/mapper/relation/component/MiddleSimpleComponentMapper.java 2008-09-19
14:51:22 UTC (rev 151)
+++
trunk/src/main/org/jboss/envers/entities/mapper/relation/component/MiddleSimpleComponentMapper.java 2008-09-21
12:21:25 UTC (rev 152)
@@ -1,7 +1,6 @@
package org.jboss.envers.entities.mapper.relation.component;
import org.jboss.envers.entities.EntityInstantiator;
-import org.jboss.envers.entities.mapper.relation.component.MiddleComponentMapper;
import org.jboss.envers.configuration.VersionsEntitiesConfiguration;
import java.util.Map;
Modified: trunk/src/main/org/jboss/envers/event/VersionsEventListener.java
===================================================================
--- trunk/src/main/org/jboss/envers/event/VersionsEventListener.java 2008-09-19 14:51:22
UTC (rev 151)
+++ trunk/src/main/org/jboss/envers/event/VersionsEventListener.java 2008-09-21 12:21:25
UTC (rev 152)
@@ -52,7 +52,7 @@
return;
}
- // Checks every property of the entity, if it is an "owned" relation to
another entity.
+ // Checks every property of the entity, if it is an "owned" to-one
relation to another entity.
// If the value of that property changed, and the relation is bi-directional, a
new revision
// for the related entity is generated.
String[] propertyNames = entityPersister.getPropertyNames();
@@ -134,7 +134,7 @@
RelationDescription relDesc =
verCfg.getEntCfg().getRelationDescription(event.getAffectedOwnerEntityName(),
workUnit.getReferencingPropertyName());
- // TODO: remove the null check (relation info should be added in the metadata
generator)
+ // relDesc can be null if this is a collection of simple values (not a
relation).
if (relDesc != null && relDesc.isBidirectional()) {
String relatedEntityName = relDesc.getToEntityName();
IdMapper relatedIdMapper =
verCfg.getEntCfg().get(relatedEntityName).getIdMapper();
Modified:
trunk/src/test/org/jboss/envers/test/integration/naming/OneToManyUnidirectionalNaming.java
===================================================================
---
trunk/src/test/org/jboss/envers/test/integration/naming/OneToManyUnidirectionalNaming.java 2008-09-19
14:51:22 UTC (rev 151)
+++
trunk/src/test/org/jboss/envers/test/integration/naming/OneToManyUnidirectionalNaming.java 2008-09-21
12:21:25 UTC (rev 152)
@@ -76,7 +76,7 @@
}
private final static String MIDDLE_VERSIONS_ENTITY_NAME =
-
"org.jboss.envers.test.integration.naming.DetachedNamingTestEntity_org.jboss.envers.test.entities.StrTestEntity_UNI_NAMING_TEST_versions";
+ "UNI_NAMING_TEST_versions";
@Test
public void testTableName() {
assert "UNI_NAMING_TEST_versions".equals(
@@ -93,11 +93,12 @@
boolean id2Found = false;
while (columns.hasNext()) {
- if ("ID_1".equals(columns.next().getName())) {
+ Column column = columns.next();
+ if ("ID_1".equals(column.getName())) {
id1Found = true;
}
- if ("ID_2".equals(columns.next().getName())) {
+ if ("ID_2".equals(column.getName())) {
id2Found = true;
}
}