Author: adamw
Date: 2008-09-22 17:20:21 -0400 (Mon, 22 Sep 2008)
New Revision: 164
Removed:
trunk/src/main/org/jboss/envers/entities/mapper/relation/OneToOneNotOwningIdMapper.java
Modified:
trunk/envers.iml
trunk/src/main/org/jboss/envers/configuration/EntitiesConfigurator.java
trunk/src/main/org/jboss/envers/configuration/VersionsEntitiesConfiguration.java
trunk/src/main/org/jboss/envers/configuration/metadata/CollectionMetadataGenerator.java
trunk/src/main/org/jboss/envers/entities/EntityConfiguration.java
trunk/src/main/org/jboss/envers/entities/mapper/SinglePropertyMapper.java
trunk/src/main/org/jboss/envers/tools/ArraysTools.java
trunk/src/main/org/jboss/envers/tools/MutableBoolean.java
trunk/src/main/org/jboss/envers/tools/MutableInteger.java
trunk/src/main/org/jboss/envers/tools/Pair.java
trunk/src/main/org/jboss/envers/tools/Triple.java
Log:
Removing dead code
Modified: trunk/envers.iml
===================================================================
--- trunk/envers.iml 2008-09-22 20:30:29 UTC (rev 163)
+++ trunk/envers.iml 2008-09-22 21:20:21 UTC (rev 164)
@@ -51,6 +51,7 @@
</orderEntry>
<orderEntry type="library" name="hibernate-common"
level="project" />
<orderEntry type="library" name="hibernate-3.2.6"
level="project" />
+ <orderEntry type="library" name="Clover IDEA Plugin"
level="application" />
<orderEntryProperties />
</component>
</module>
Modified: trunk/src/main/org/jboss/envers/configuration/EntitiesConfigurator.java
===================================================================
--- trunk/src/main/org/jboss/envers/configuration/EntitiesConfigurator.java 2008-09-22
20:30:29 UTC (rev 163)
+++ trunk/src/main/org/jboss/envers/configuration/EntitiesConfigurator.java 2008-09-22
21:20:21 UTC (rev 164)
@@ -95,12 +95,12 @@
try {
cfg.addDocument(writer.write(xmlMappingData.getMainXmlMapping()));
// TODO
- writeDocument(xmlMappingData.getMainXmlMapping());
+ //writeDocument(xmlMappingData.getMainXmlMapping());
for (Document additionalMapping :
xmlMappingData.getAdditionalXmlMappings()) {
cfg.addDocument(writer.write(additionalMapping));
// TODO
- writeDocument(additionalMapping);
+ //writeDocument(additionalMapping);
}
} catch (DocumentException e) {
throw new MappingException(e);
Modified:
trunk/src/main/org/jboss/envers/configuration/VersionsEntitiesConfiguration.java
===================================================================
---
trunk/src/main/org/jboss/envers/configuration/VersionsEntitiesConfiguration.java 2008-09-22
20:30:29 UTC (rev 163)
+++
trunk/src/main/org/jboss/envers/configuration/VersionsEntitiesConfiguration.java 2008-09-22
21:20:21 UTC (rev 164)
@@ -97,15 +97,6 @@
return versionsTablePrefix + entityName + versionsTableSuffix;
}
- public boolean isVersionsEntityName(String entityName) {
- if (entityName == null) {
- return false;
- }
-
- return entityName.endsWith(versionsTableSuffix) &&
- entityName.startsWith(versionsTablePrefix);
- }
-
public String getVersionsTableName(String entityName, String tableName) {
String customHistoryTableName = customVersionsTablesNames.get(entityName);
if (customHistoryTableName == null) {
Modified:
trunk/src/main/org/jboss/envers/configuration/metadata/CollectionMetadataGenerator.java
===================================================================
---
trunk/src/main/org/jboss/envers/configuration/metadata/CollectionMetadataGenerator.java 2008-09-22
20:30:29 UTC (rev 163)
+++
trunk/src/main/org/jboss/envers/configuration/metadata/CollectionMetadataGenerator.java 2008-09-22
21:20:21 UTC (rev 164)
@@ -190,7 +190,7 @@
mappedBy = getMappedBy(propertyValue.getCollectionTable(),
mainGenerator.getCfg().getClassMapping(referencedEntityName));
referencingPrefixRelated = mappedBy + "_";
- referencedPrefix = referencedEntityName == null ? "element" :
StringTools.getLastComponent(referencedEntityName);
+ referencedPrefix = StringTools.getLastComponent(referencedEntityName);
} else {
mappedBy = null;
Modified: trunk/src/main/org/jboss/envers/entities/EntityConfiguration.java
===================================================================
--- trunk/src/main/org/jboss/envers/entities/EntityConfiguration.java 2008-09-22 20:30:29
UTC (rev 163)
+++ trunk/src/main/org/jboss/envers/entities/EntityConfiguration.java 2008-09-22 21:20:21
UTC (rev 164)
@@ -97,10 +97,6 @@
return propertyMapper;
}
- public String getEntityName() {
- return entityName;
- }
-
// For use by EntitiesConfigurations
String getParentEntityName() {
Modified: trunk/src/main/org/jboss/envers/entities/mapper/SinglePropertyMapper.java
===================================================================
--- trunk/src/main/org/jboss/envers/entities/mapper/SinglePropertyMapper.java 2008-09-22
20:30:29 UTC (rev 163)
+++ trunk/src/main/org/jboss/envers/entities/mapper/SinglePropertyMapper.java 2008-09-22
21:20:21 UTC (rev 164)
@@ -41,10 +41,6 @@
public class SinglePropertyMapper implements PropertyMapper, SimpleMapperBuilder {
private String propertyName;
- public SinglePropertyMapper(String propertyName, ModificationStore modStore) {
- this.propertyName = propertyName;
- }
-
public SinglePropertyMapper() { }
public void add(String propertyName, ModificationStore modStore) {
Deleted:
trunk/src/main/org/jboss/envers/entities/mapper/relation/OneToOneNotOwningIdMapper.java
===================================================================
---
trunk/src/main/org/jboss/envers/entities/mapper/relation/OneToOneNotOwningIdMapper.java 2008-09-22
20:30:29 UTC (rev 163)
+++
trunk/src/main/org/jboss/envers/entities/mapper/relation/OneToOneNotOwningIdMapper.java 2008-09-22
21:20:21 UTC (rev 164)
@@ -1,87 +0,0 @@
-/*
- * Envers.
http://www.jboss.org/envers
- *
- * Copyright 2008 Red Hat Middleware, LLC. All rights reserved.
- *
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT A WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License, v.2.1 along with this distribution; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- * 02110-1301, USA.
- *
- * Red Hat Author(s): Adam Warski
- */
-package org.jboss.envers.entities.mapper.relation;
-
-import org.jboss.envers.entities.mapper.PropertyMapper;
-import org.jboss.envers.entities.mapper.PersistentCollectionChangeData;
-import org.jboss.envers.reader.VersionsReaderImplementor;
-import org.jboss.envers.tools.reflection.ReflectionTools;
-import org.jboss.envers.query.VersionsRestrictions;
-import org.jboss.envers.exception.VersionsException;
-import org.jboss.envers.configuration.VersionsConfiguration;
-import org.hibernate.property.Setter;
-import org.hibernate.NonUniqueResultException;
-import org.hibernate.collection.PersistentCollection;
-
-import javax.persistence.NoResultException;
-import java.util.Map;
-import java.util.List;
-import java.io.Serializable;
-
-/**
- * @author Adam Warski (adam at warski dot org)
- */
-public class OneToOneNotOwningIdMapper implements PropertyMapper {
- private String owningReferencePropertyName;
- private String owningEntityName;
- private String propertyName;
-
- public OneToOneNotOwningIdMapper(String owningReferencePropertyName, String
owningEntityName, String propertyName) {
- this.owningReferencePropertyName = owningReferencePropertyName;
- this.owningEntityName = owningEntityName;
- this.propertyName = propertyName;
- }
-
- public boolean mapToMapFromEntity(Map<String, Object> data, Object newObj,
Object oldObj) {
- return false;
- }
-
- public void mapToEntityFromMap(VersionsConfiguration verCfg, Object obj, Map data,
Object primaryKey, VersionsReaderImplementor versionsReader, Number revision) {
- if (obj == null) {
- return;
- }
-
- Class<?> entityClass = ReflectionTools.loadClass(owningEntityName);
-
- Object value;
-
- try {
- value = versionsReader.createQuery().forEntitiesAtRevision(entityClass,
revision)
- .add(VersionsRestrictions.relatedIdEq(owningReferencePropertyName,
primaryKey)).getSingleResult();
- } catch (NoResultException e) {
- value = null;
- } catch (NonUniqueResultException e) {
- throw new VersionsException("Many versions results for one-to-one
relationship: (" + owningEntityName +
- ", " + owningReferencePropertyName + ")");
- }
-
- Setter setter = ReflectionTools.getSetter(obj.getClass(), propertyName);
- setter.set(obj, value, null);
- }
-
- public List<PersistentCollectionChangeData> mapCollectionChanges(String
referencingPropertyName,
-
PersistentCollection newColl,
-
Serializable oldColl,
-
Serializable id) {
- return null;
- }
-}
Modified: trunk/src/main/org/jboss/envers/tools/ArraysTools.java
===================================================================
--- trunk/src/main/org/jboss/envers/tools/ArraysTools.java 2008-09-22 20:30:29 UTC (rev
163)
+++ trunk/src/main/org/jboss/envers/tools/ArraysTools.java 2008-09-22 21:20:21 UTC (rev
164)
@@ -34,16 +34,4 @@
return false;
}
-
- public static <T> int indexInArray(T[] array, T object) {
- if (array != null) {
- for (int i=0; i<array.length; i++) {
- if (Tools.objectsEqual(array[i], object)) {
- return i;
- }
- }
- }
-
- return -1;
- }
}
Modified: trunk/src/main/org/jboss/envers/tools/MutableBoolean.java
===================================================================
--- trunk/src/main/org/jboss/envers/tools/MutableBoolean.java 2008-09-22 20:30:29 UTC (rev
163)
+++ trunk/src/main/org/jboss/envers/tools/MutableBoolean.java 2008-09-22 21:20:21 UTC (rev
164)
@@ -45,8 +45,4 @@
public void unset() {
value = false;
}
-
- public void setTo(boolean value) {
- this.value = value;
- }
}
Modified: trunk/src/main/org/jboss/envers/tools/MutableInteger.java
===================================================================
--- trunk/src/main/org/jboss/envers/tools/MutableInteger.java 2008-09-22 20:30:29 UTC (rev
163)
+++ trunk/src/main/org/jboss/envers/tools/MutableInteger.java 2008-09-22 21:20:21 UTC (rev
164)
@@ -30,18 +30,6 @@
public MutableInteger() {
}
- public MutableInteger(int value) {
- this.value = value;
- }
-
- public int get() {
- return value;
- }
-
- public void set(int value) {
- this.value = value;
- }
-
public int getAndIncrease() {
return value++;
}
Modified: trunk/src/main/org/jboss/envers/tools/Pair.java
===================================================================
--- trunk/src/main/org/jboss/envers/tools/Pair.java 2008-09-22 20:30:29 UTC (rev 163)
+++ trunk/src/main/org/jboss/envers/tools/Pair.java 2008-09-22 21:20:21 UTC (rev 164)
@@ -31,9 +31,6 @@
private T1 obj1;
private T2 obj2;
- public Pair() {
- }
-
public Pair(T1 obj1, T2 obj2) {
this.obj1 = obj1;
this.obj2 = obj2;
@@ -47,14 +44,6 @@
return obj2;
}
- public void setFirst(T1 obj1) {
- this.obj1 = obj1;
- }
-
- public void setSecond(T2 obj2) {
- this.obj2 = obj2;
- }
-
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof Pair)) return false;
Modified: trunk/src/main/org/jboss/envers/tools/Triple.java
===================================================================
--- trunk/src/main/org/jboss/envers/tools/Triple.java 2008-09-22 20:30:29 UTC (rev 163)
+++ trunk/src/main/org/jboss/envers/tools/Triple.java 2008-09-22 21:20:21 UTC (rev 164)
@@ -33,9 +33,6 @@
private T2 obj2;
private T3 obj3;
- public Triple() {
- }
-
public Triple(T1 obj1, T2 obj2, T3 obj3) {
this.obj1 = obj1;
this.obj2 = obj2;
@@ -54,18 +51,6 @@
return obj3;
}
- public void setFirst(T1 obj1) {
- this.obj1 = obj1;
- }
-
- public void setSecond(T2 obj2) {
- this.obj2 = obj2;
- }
-
- public void setThird(T3 obj3) {
- this.obj3 = obj3;
- }
-
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof Triple)) return false;