mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Merged V4.0-BUG-FIX to HEAD
37410: ALF-14386 HttpClient returns a null byte array if there is no response body (eg 204), swap that for an empty array to avoid NPEs and better fit the interface contract 37439: ALF-13979: Schema comparison NPE when encountering a keyless table 37443: Hand merge of second round of PATH query improvements for ALF-13404 to doclib2 API scripts 37480: Merged V4.0 to V4.0-BUG-FIX 37470: ALF-14434: Specify a START WITH value for the rebuilt alf_acl_change_set primary key on DB2 37475: ALF-13839: Transaction purging didn't work on SQL Server! 37484: Merged PATCHES/V3.4.6 to V4.0-BUG-FIX (RECORD ONLY) 36821: ALF-13827: Make replicated caches recover from temporary comms failures by flushing when a change in peers is detected - We do not flush caches who replicate via copy (e.g. tickets cache) as these may not be recoverable 37487: Merged V3.4-BUG-FIX to V4.0-BUG-FIX 37225: ALF-13617 Revert To Version functionality incorrectly reverts to the wrong version/file 37280: Merged DEV to V3.4-BUG-FIX 37279: ALF-14360 : Missing caches from ehcache-custom.xml.sample.cluster org.alfresco.cache.avm.avmVersionRootEntityCache and org.alfresco.cache.tagscopeSummaryCache were added to the ehcache configuration. 37473: ALF-12081: Ensure that cancel checkout can both unlock and cancel offline edit 37478: Merged BRANCHES/DEV/BELARUS/V3.4-BUG-FIX-2012_05_22 to BRANCHES/DEV/V3.4-BUG-FIX: 37471: ALF-9475 : Remove JBPM indexes present from upgrades 37485: ALF-9475: Fix up schema versions 37488: Merged V3.4-BUG-FIX to V4.0-BUG-FIX (RECORD ONLY) 37330: Merged V4.0-BUG-FIX to V3.4-BUG-FIX 37323: ALF-13247: Two nodes with the same primary path. -Fixed by initializing zone before parallel batch processing begins. 37356: ALF-14392: Merged V4.0-BUG-FIX to V3.4-BUG-FIX 36346: Fix for ALF-9466 - We can search contents sorted by categories in Advanced search in Share, but saved search will not be shown in UI. 37373: Merged PATCHES/V3.4.6 to V3.4-BUG-FIX 36821: ALF-13827 / ALF-14402: Make replicated caches recover from temporary comms failures by flushing when a change in peers is detected - We do not flush caches who replicate via copy (e.g. tickets cache) as these may not be recoverable 37122: ALF-13919 / ALF-14403: Merged DEV to PATCHES/V3.4.6 - Rework of Dmitry's implementation - Uses dynamic HQL query to retrieve JBPM workflow instances by specified query criteria - WorkflowInstancesGet web script no longer has to iterate over every workflow instance in the database! - DB index added to enable efficient querying by string variable - Hibernate tastic! 37188: ALF-13919 / ALF-14403: Worked around HQL polymorphism issues by using explicit variable subclass names in from clause 37204: ALF-13919 / ALF-14403: Fix to date range handling by Dmitry 37481: Merged HEAD to V3.4-BUG-FIX 37388: ALF-13545: First attempt at digitally signing the Windows installers 37391: ALF-13545: Fix quoting and output directory specification 37393: ALF-13545: Correct deployment installer signcode command git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@37491 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -206,7 +206,10 @@ public class DbObjectXMLTransformer
|
||||
simpleEndTag(XML.EL_COLUMNS);
|
||||
|
||||
// Output primary key
|
||||
output(table.getPrimaryKey());
|
||||
if (table.hasPrimaryKey())
|
||||
{
|
||||
output(table.getPrimaryKey());
|
||||
}
|
||||
|
||||
// Output foreign keys
|
||||
simpleStartTag(XML.EL_FOREIGN_KEYS);
|
||||
|
@@ -24,6 +24,7 @@ import static org.alfresco.util.schemacomp.SchemaCompTestingUtils.fk;
|
||||
import static org.alfresco.util.schemacomp.SchemaCompTestingUtils.fkeys;
|
||||
import static org.alfresco.util.schemacomp.SchemaCompTestingUtils.indexes;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
@@ -264,6 +265,26 @@ public class DbObjectXMLTransformerTest
|
||||
assertEquals("</table>", reader.readLine());
|
||||
}
|
||||
|
||||
/**
|
||||
* ALF-13979: empty table causes NPE during schema export.
|
||||
* @throws IOException
|
||||
*/
|
||||
@Test
|
||||
public void transformTableWithoutPrimaryKey() throws IOException
|
||||
{
|
||||
Table table = new Table("my_table");
|
||||
assertFalse(table.hasPrimaryKey());
|
||||
|
||||
transformer.output(table);
|
||||
|
||||
BufferedReader reader = new BufferedReader(new StringReader(writer.toString()));
|
||||
dumpOutput();
|
||||
assertHasPreamble(reader);
|
||||
skipUntilEnd(" {columns}", reader, true);
|
||||
skipUntilEnd(" {foreignkeys}", reader, true);
|
||||
skipUntilEnd(" {indexes}", reader, true);
|
||||
assertEquals("</table>", reader.readLine());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void transformObjectWithValidators() throws IOException
|
||||
@@ -332,7 +353,7 @@ public class DbObjectXMLTransformerTest
|
||||
{
|
||||
textToFind = textToFind.trim().
|
||||
replace("{", "<").
|
||||
replace("}", "\\s+.*/>");
|
||||
replace("}", ".*/>");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@@ -102,6 +102,13 @@ public class Table extends AbstractDbObject
|
||||
return this.primaryKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Whether there is a primary key on this table.
|
||||
*/
|
||||
public boolean hasPrimaryKey()
|
||||
{
|
||||
return (primaryKey != null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param primaryKey the primaryKey to set
|
||||
|
Reference in New Issue
Block a user