Changeset 7461
- Timestamp:
- Mar 14, 2018, 2:17:56 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/3.12-stable (added) merged: 7455-7458 /tags/3.12 (added) merged: 7459
- Property svn:mergeinfo changed
-
trunk/build.xml
r7454 r7461 69 69 <property name="base.minorversion" value="13" /> 70 70 <property name="base.maintenanceversion" value="0" /> 71 <property name="base.versionsuffix" value=" -dev" />71 <property name="base.versionsuffix" value="" /> 72 72 <property name="base.version" 73 73 value="${base.majorversion}.${base.minorversion}.${base.maintenanceversion}" /> -
trunk/doc/src/docbook/admin/installation.xml
r7390 r7461 47 47 48 48 <important id="installation.upgrade.important"> 49 <title>Important information for upgrading to BASE 3.1 1.1</title>49 <title>Important information for upgrading to BASE 3.12</title> 50 50 <para> 51 51 This section list some important information that may or may not 52 52 apply when upgrading from the <emphasis>previous</emphasis> BASE 53 release to the current release (eg. 3.1 0 to 3.11). If you are54 upgrading from a BASE installation that is older (3.0-3. 9)53 release to the current release (eg. 3.11 to 3.12). If you are 54 upgrading from a BASE installation that is older (3.0-3.10) 55 55 you should also read <xref linkend="appendix.update_warnings" />. 56 56 </para> 57 57 58 <bridgehead> Free wells on bioplates</bridgehead>58 <bridgehead>BASE 3.12</bridgehead> 59 59 <para> 60 A bug that affected the free wells information on bioplates 61 has been fixed. Existing bioplates may have incorrect number of 62 free wells and can be fixed by running a special script. 63 64 After installing the BASE 3.11.1 update, change directory to 65 <filename class="directory"><base-dir>/bin/</filename> 66 and issue 67 <programlisting> 68 ./onetimefix.sh free_wells -u <root login> -p <root pwd> 69 </programlisting> 60 There are no special instructions for this update. 70 61 </para> 71 62 </important> -
trunk/src/core/net/sf/basedb/core/AbstractHqlQuery.java
r7381 r7461 46 46 class can be used to build and manage just about any type of HQL 47 47 query. It has no function for executing the query or returning 48 the result. Subclasses may use {@link #getMainHqlQuery(DbControl )}48 the result. Subclasses may use {@link #getMainHqlQuery(DbControl, Class)} 49 49 to generate a Hibernate Query object that is ready to be executed. 50 50 -
trunk/src/core/net/sf/basedb/core/Annotation.java
r7381 r7461 745 745 <p> 746 746 An exception to the above (since BASE 3.11) is if the annotation was loaded with 747 {@link AnnotationSet#getProjectAnnotation(AnnotationType, int)} in747 {@link AnnotationSet#getProjectAnnotation(AnnotationType, Project)} in 748 748 which case currently active project is ignored and the values are 749 749 always changed on this annotation (eg. the same as if this annotation -
trunk/src/core/net/sf/basedb/core/AnnotationBetweenRestriction.java
r7381 r7461 70 70 /** 71 71 @since 3.5 72 @deprecated In 3.11, use {@link #AnnotationBetweenRestriction(String, AnnotationType, Object, Object, Options)} instead72 @deprecated In 3.11, use {@link #AnnotationBetweenRestriction(String, AnnotationType, Object, Object, AnnotationRestriction.Options)} instead 73 73 */ 74 74 @Deprecated … … 83 83 /** 84 84 @since 3.5 85 @deprecated In 3.11, use {@link #AnnotationBetweenRestriction(String, AnnotationType, Object, Object, Options)} instead85 @deprecated In 3.11, use {@link #AnnotationBetweenRestriction(String, AnnotationType, Object, Object, AnnotationRestriction.Options)} instead 86 86 */ 87 87 @Deprecated -
trunk/src/core/net/sf/basedb/core/AnnotationInRestriction.java
r7381 r7461 58 58 /** 59 59 @since 3.5 60 @deprecated In 3.11, use {@link #AnnotationInRestriction(String, AnnotationType, Options, Object...)} instead60 @deprecated In 3.11, use {@link #AnnotationInRestriction(String, AnnotationType, AnnotationRestriction.Options, Object...)} instead 61 61 */ 62 62 @Deprecated -
trunk/src/core/net/sf/basedb/core/AnnotationRestriction.java
r7381 r7461 39 39 Base class for creating restrictions based on annotations. 40 40 Subclasses must implent the {@link #getRestrictionSql(Query, DbControl)} 41 and {@link #setRestrictionParameters( SQLQuery)}41 and {@link #setRestrictionParameters(NativeQuery)} 42 42 method. 43 43 … … 316 316 @param query The query object we are about to execute 317 317 @return An SQL fragment, or null if no additional restriction is required 318 @see #setRestrictionParameters( SQLQuery)318 @see #setRestrictionParameters(NativeQuery) 319 319 */ 320 320 abstract String getRestrictionSql(Query query, DbControl dc) -
trunk/src/core/net/sf/basedb/core/AnnotationSimpleRestriction.java
r7381 r7461 64 64 /** 65 65 @since 3.5 66 @deprecated In 3.11, use {@link #AnnotationSimpleRestriction(String, AnnotationType, Operator, Object, Options)} instead66 @deprecated In 3.11, use {@link #AnnotationSimpleRestriction(String, AnnotationType, Operator, Object, AnnotationRestriction.Options)} instead 67 67 */ 68 68 @Deprecated … … 125 125 /** 126 126 @since 3.5 127 @deprecated In 3.11, use {@link #AnnotationSimpleRestriction(String, AnnotationType, Operator, Object, Options)} instead127 @deprecated In 3.11, use {@link #AnnotationSimpleRestriction(String, AnnotationType, Operator, Object, AnnotationRestriction.Options)} instead 128 128 */ 129 129 @Deprecated … … 163 163 /** 164 164 @since 3.5 165 @deprecated In 3.11, use {@link #AnnotationSimpleRestriction(String, AnnotationType, Operator, List,Options)} instead165 @deprecated In 3.11, use {@link #AnnotationSimpleRestriction(String, AnnotationType, Operator, Object, AnnotationRestriction.Options)} instead 166 166 */ 167 167 @Deprecated -
trunk/src/core/net/sf/basedb/core/HasAnnotationRestriction.java
r7381 r7461 76 76 by the query or not 77 77 @since 3.5 78 @deprecated In 3.11, use {@link #HasAnnotationRestriction(String, AnnotationType, boolean, Options)} instead78 @deprecated In 3.11, use {@link #HasAnnotationRestriction(String, AnnotationType, boolean, AnnotationRestriction.Options)} instead 79 79 */ 80 80 @Deprecated … … 106 106 107 107 /** 108 @see #HasAnnotationRestriction(String, AnnotationType, boolean, boolean, boolean)108 @see #HasAnnotationRestriction(String, AnnotationType, boolean, AnnotationRestriction.Options) 109 109 @since 3.5 110 @deprecated In 3.11, use {@link #HasAnnotationRestriction(String, AnnotationType, boolean, Options)} instead110 @deprecated In 3.11, use {@link #HasAnnotationRestriction(String, AnnotationType, boolean, AnnotationRestriction.Options)} instead 111 111 */ 112 112 @Deprecated -
trunk/src/core/net/sf/basedb/core/HibernateUtil.java
r7416 r7461 2047 2047 using a query. 2048 2048 2049 @param clazz The list should contain objects of this class2050 2049 @param query The query to execute 2051 2050 @param sc A optional SessionControl that is automatically protected from … … 2074 2073 /** 2075 2074 Scroll through the result of a query using an iterator. 2076 @param clazz The iterator returns objects of this class2077 2075 @param query The query to execute 2078 2076 @param sc A optional SessionControl that is automatically protected from -
trunk/src/core/net/sf/basedb/core/Job.java
r7381 r7461 1117 1117 1118 1118 /** 1119 @see {@link #start(String, String, String, JobAgent, Date)}1119 @see #start(String, String, String, JobAgent, Date) 1120 1120 @since 3.3 1121 1121 */ … … 1517 1517 1518 1518 /** 1519 @see {@link #execute(ProgressReporter, String, String, JobAgentSettings)}1519 @see #execute(ProgressReporter, String, String, JobAgentSettings) 1520 1520 */ 1521 1521 public PluginExecutionRequest execute(ProgressReporter progress, String server, JobAgentSettings settings) -
trunk/src/core/net/sf/basedb/core/QueryExecutor.java
r7381 r7461 112 112 /** 113 113 Executes a Hibernate query that returns an iterator on a stateless session. 114 @param clazz The class of items returned by the iterator115 114 @param query The query to execute 116 115 @param session The stateless session, this must be the same session -
trunk/src/core/net/sf/basedb/core/ServiceSessionControl.java
r7396 r7461 346 346 347 347 // Check if the schema exists or not 348 boolean schemaExists = HibernateUtil.doReturningWork(session, new SchemaExistsWork( catalog, schema));348 boolean schemaExists = HibernateUtil.doReturningWork(session, new SchemaExistsWork(actualCatalog, actualSchema)); 349 349 installMode = schemaExists ? SchemaGenerator.Mode.UPDATE : SchemaGenerator.Mode.INSTALL; 350 350 if (log.isDebugEnabled()) log.debug("Mode: " +installMode); -
trunk/src/core/net/sf/basedb/core/Update.java
r7413 r7461 58 58 import net.sf.basedb.core.data.KitData; 59 59 import net.sf.basedb.core.data.MeasuredBioMaterialData; 60 import net.sf.basedb.core.data.NewsData; 60 61 import net.sf.basedb.core.data.ParameterValueData; 61 62 import net.sf.basedb.core.data.PropertyFilterData; -
trunk/src/core/net/sf/basedb/core/User.java
r7452 r7461 599 599 enable this feature by itself, the email address must first 600 600 be verified. 601 @see #sendEmailVerificationCode( )601 @see #sendEmailVerificationCode(String) 602 602 @see #enableDeviceVerification(String) 603 603 @since 3.12 … … 616 616 Send a verification code to the currently registered email address. 617 617 The client application should ask the user to enter the verification 618 code and then call {@link # verifyEmail(String)}. The verification must618 code and then call {@link #enableDeviceVerification(String)}. The verification must 619 619 be done with the same User instance since the verification code 620 620 is only temporarily stored inside this instance. … … 666 666 Verify the email and enables device verification. 667 667 @param code The code that was sent by email to the user 668 @see #sendEmailVerificationCode( )668 @see #sendEmailVerificationCode(String) 669 669 @since 3.12 670 670 */ -
trunk/src/core/net/sf/basedb/core/data/UserDeviceData.java
r7414 r7461 172 172 /** 173 173 The maximum length of the remote ID that can be stored in the database. 174 @see #set RemoteId(String)174 @see #setLastRemoteId(String) 175 175 */ 176 176 public static final int MAX_REMOTE_ID_LENGTH = 255; -
trunk/src/core/net/sf/basedb/core/hibernate/SchemaGenerator.java
r7397 r7461 22 22 package net.sf.basedb.core.hibernate; 23 23 24 import java.lang.reflect.Field;25 24 import java.sql.Connection; 25 import java.sql.DatabaseMetaData; 26 26 import java.sql.SQLException; 27 27 import java.sql.Statement; … … 30 30 import java.util.EnumSet; 31 31 import java.util.HashMap; 32 import java.util.Iterator; 32 33 import java.util.List; 33 34 import java.util.Map; 34 35 36 import net.sf.basedb.core.DatabaseException; 35 37 import net.sf.basedb.core.ProgressReporter; 36 38 import net.sf.basedb.core.StringUtil; 37 39 import net.sf.basedb.core.dbengine.DbEngine; 40 import net.sf.basedb.core.dbengine.TableInfo; 38 41 import net.sf.basedb.util.EqualsHelper; 39 42 40 43 import org.hibernate.boot.Metadata; 41 44 import org.hibernate.boot.model.naming.Identifier; 42 import org.hibernate.boot.model.relational.QualifiedName;43 import org.hibernate.boot.model.relational.QualifiedSequenceName;44 45 import org.hibernate.boot.model.relational.QualifiedTableName; 45 46 import org.hibernate.boot.spi.MetadataImplementor; 46 47 import org.hibernate.dialect.Dialect; 47 import org.hibernate.engine.jdbc.env.internal. JdbcEnvironmentImpl;48 import org.hibernate.engine.jdbc.env.internal.QualifiedObjectNameFormatterStandardImpl; 48 49 import org.hibernate.engine.jdbc.env.spi.JdbcEnvironment; 49 50 import org.hibernate.engine.jdbc.env.spi.QualifiedObjectNameFormatter; 50 51 import org.hibernate.jdbc.Work; 52 import org.hibernate.mapping.Table; 51 53 import org.hibernate.service.ServiceRegistry; 52 54 import org.hibernate.service.spi.ServiceRegistryImplementor; 53 55 import org.hibernate.tool.schema.SourceType; 54 56 import org.hibernate.tool.schema.TargetType; 57 import org.hibernate.tool.schema.extract.spi.DatabaseInformation; 58 import org.hibernate.tool.schema.extract.spi.TableInformation; 55 59 import org.hibernate.tool.schema.internal.SchemaCreatorImpl; 60 import org.hibernate.tool.schema.internal.exec.JdbcContext; 56 61 import org.hibernate.tool.schema.internal.ExceptionHandlerHaltImpl; 62 import org.hibernate.tool.schema.internal.Helper; 57 63 import org.hibernate.tool.schema.internal.HibernateSchemaManagementTool; 58 import org.hibernate.tool.schema.internal.IndividuallySchemaMigratorImpl;59 64 import org.hibernate.tool.schema.spi.ExceptionHandler; 60 65 import org.hibernate.tool.schema.spi.ExecutionOptions; 61 66 import org.hibernate.tool.schema.spi.SchemaCreator; 62 import org.hibernate.tool.schema.spi.SchemaMigrator;63 67 import org.hibernate.tool.schema.spi.ScriptSourceInput; 64 68 import org.hibernate.tool.schema.spi.ScriptTargetOutput; … … 117 121 ----------------------- 118 122 */ 123 @SuppressWarnings("unchecked") 119 124 @Override 120 125 public void execute(Connection connection) … … 131 136 String currentSql = null; 132 137 boolean autoCommit = connection.getAutoCommit(); 133 ForceQuotedTableNameFormatter tableNameFormatter = new ForceQuotedTableNameFormatter(metadata); 138 134 139 try 135 140 { … … 144 149 { 145 150 log.info("Generating schema update script"); 146 tableNameFormatter.applyWorkaroundForHibernateBug(); 147 SchemaMigrator schemaMigrator = new IndividuallySchemaMigratorImpl(tool, null); 148 schemaMigrator.doMigration(metadata, schemaUpdates, schemaUpdates); 151 152 DatabaseMetaData jdbcMetaData = connection.getMetaData(); 153 JdbcContext jdbcContext = tool.resolveJdbcContext(schemaUpdates.getConfigurationValues()); 154 JdbcEnvironment jdbcEnvironment = metadata.getDatabase().getJdbcEnvironment(); 155 156 QualifiedObjectNameFormatter tableNameFormatter = new QualifiedObjectNameFormatterStandardImpl(jdbcEnvironment.getNameQualifierSupport()); 157 158 DatabaseInformation hibernateDbInfo = Helper.buildDatabaseInformation(serviceRegistry, 159 tool.getDdlTransactionIsolator(jdbcContext), 160 metadata.getDatabase().getDefaultNamespace().getName()); 161 162 Iterator<Table> tables = metadata.collectTableMappings().iterator(); 163 while (tables.hasNext()) 164 { 165 Table table = tables.next(); 166 TableInfo jdbcTableInfo = new TableInfo(table, jdbcMetaData); 167 168 log.debug("Table: " + table + (jdbcTableInfo.existsInDb() ? " EXISTS" : "NOT FOUND")); 169 170 if (jdbcTableInfo.existsInDb()) 171 { 172 // This table exists in the database, we need to force Hibernate to check and ALTER it if needed 173 QualifiedTableName qft = table.getQualifiedTableName(); 174 175 // First try: let Hibernate use the default settings to find the table 176 TableInformation hibernateTableInfo = hibernateDbInfo.getTableInformation(qft); 177 178 if (log.isDebugEnabled()) log.debug(qft + ": " + hibernateTableInfo); 179 180 if (hibernateTableInfo == null) 181 { 182 // If that fails, we need to try again with unquoted table name 183 qft = new QualifiedTableName(qft.getCatalogName(), qft.getSchemaName(), Identifier.toIdentifier(table.getName(), false)); 184 hibernateTableInfo = hibernateDbInfo.getTableInformation(qft); 185 if (log.isDebugEnabled()) log.debug(qft + ": " + hibernateTableInfo); 186 187 // If this is null here we are in trouble!!! 188 if (hibernateTableInfo == null) 189 { 190 throw new DatabaseException("Table '" + table.getName() + "' exists, but Hibernate can't find any information about it. "+ 191 "Please report as a bug to the BASE developers"); 192 } 193 } 194 195 // To get the quoting, upper- and lower-case correct we need to re-create a new instance 196 // and do a search-and-replace in the SQL generated by Hibernate 197 qft = new QualifiedTableName(hibernateTableInfo.getName().getCatalogName(), hibernateTableInfo.getName().getSchemaName(), table.getNameIdentifier()); 198 String correctTableName = tableNameFormatter.format(qft, dialect); 199 String tableNameGeneratedByHibernate = tableNameFormatter.format(hibernateTableInfo.getName(), dialect); 200 if (log.isDebugEnabled()) 201 { 202 log.debug("Search-and-replace: " + tableNameGeneratedByHibernate + "-->" + correctTableName); 203 } 204 Iterator<String> it = (Iterator<String>)table.sqlAlterStrings(dialect, metadata, hibernateTableInfo, null, null); 205 while (it.hasNext()) 206 { 207 String sql = it.next(); 208 String modifiedSql = sql.replace(tableNameGeneratedByHibernate, correctTableName); 209 if (!sql.equals(modifiedSql)) 210 { 211 log.debug("Hibernate SQL: " + sql); 212 log.debug("Modified SQL: " + modifiedSql); 213 } 214 schemaUpdates.accept(modifiedSql); 215 } 216 } 217 else 218 { 219 String[] sql = dialect.getTableExporter().getSqlCreateStrings(table, metadata); 220 for (String s : sql) 221 { 222 schemaUpdates.accept(s); 223 } 224 } 225 } 149 226 } 150 227 else if (mode == Mode.INSTALL) … … 223 300 { 224 301 if (autoCommit != connection.getAutoCommit()) connection.setAutoCommit(autoCommit); 225 tableNameFormatter.resetWorkaroundForHibernateBug();226 302 if (stmt != null) 227 303 { … … 416 492 } 417 493 418 419 /**420 Replace the 'QualifiedObjectNameFormatter' with an implementation that forces421 all table names to be flagged as quoted. This is a hack to work around a bug422 in Hibernate which generates "alter table table-name add column ..."423 statements without quotes around the table-name which causes an error424 425 TODO - When (if?) this issue is fixed in Hibernate we can remove this workaround426 */427 static class ForceQuotedTableNameFormatter428 implements QualifiedObjectNameFormatter429 {430 431 private final Metadata metadata;432 private final JdbcEnvironment jdbc;433 private QualifiedObjectNameFormatter originalFormatter;434 435 ForceQuotedTableNameFormatter(Metadata metadata)436 {437 this.metadata = metadata;438 this.jdbc = metadata.getDatabase().getJdbcEnvironment();439 }440 441 @Override442 public String format(QualifiedTableName tableName, Dialect dialect)443 {444 QualifiedTableName quotedTableName = new QualifiedTableName(445 tableName.getCatalogName(),446 tableName.getSchemaName(),447 Identifier.toIdentifier(tableName.getTableName().getText(), true)448 );449 return originalFormatter.format(quotedTableName, dialect);450 }451 452 @Override453 public String format(QualifiedSequenceName sequenceName, Dialect dialect)454 {455 return originalFormatter.format(sequenceName, dialect);456 }457 458 @Override459 public String format(QualifiedName name, Dialect dialect)460 {461 return originalFormatter.format(name, dialect);462 }463 464 void applyWorkaroundForHibernateBug()465 {466 this.originalFormatter = jdbc.getQualifiedObjectNameFormatter();467 setFormatter(this);468 }469 470 void resetWorkaroundForHibernateBug()471 {472 if (originalFormatter != null) setFormatter(originalFormatter);473 }474 475 private void setFormatter(QualifiedObjectNameFormatter formatter)476 {477 try478 {479 Field f = JdbcEnvironmentImpl.class.getDeclaredField("qualifiedObjectNameFormatter");480 f.setAccessible(true);481 f.set(jdbc, formatter);482 }483 catch (Exception ex)484 {485 throw new RuntimeException(ex);486 }487 }488 489 }490 494 491 495 } -
trunk/src/core/net/sf/basedb/util/HttpUtil.java
r7411 r7461 139 139 Parse the User-Agent string from a HTTP request and return 140 140 information about what it actually means. 141 @see https://github.com/nielsbasjes/yauaa141 @see <a href="https://github.com/nielsbasjes/yauaa">https://github.com/nielsbasjes/yauaa</a> 142 142 @since 3.12 143 143 */ -
trunk/src/core/net/sf/basedb/util/ProgressInputStream.java
r7168 r7461 81 81 /** 82 82 Send a progress report with the given message. This method is called 83 auto amtically at the given intervals. The default message is the number83 automatically at the given intervals. The default message is the number 84 84 of bytes read so far (formatted as a string with 85 85 {@link Values#formatBytes(Long, int)}). Subclasses may override this 86 86 method to generate a different message. 87 88 @param message89 87 */ 90 88 protected void progressReport(String message) -
trunk/src/core/net/sf/basedb/util/extensions/ActionIterator.java
r7275 r7461 173 173 /** 174 174 Send the event to event handlers registered in the registry. 175 @see Registry#handleEvent(EventType, ExtensionPoint, Extension) }175 @see Registry#handleEvent(EventType, ExtensionPoint, Extension) 176 176 @since 3.10 177 177 */ -
trunk/src/core/net/sf/basedb/util/extensions/manager/processor/IgnoreFileProcessor.java
r7233 r7461 100 100 it happend when the {@link #done(ExtensionsManager)} method is 101 101 called by the manager. If this flag is set the 102 {@link #finalizeRegistration(ExtensionsManager , boolean)}102 {@link #finalizeRegistration(ExtensionsManager)} 103 103 method must be explicitely called. 104 104 */ -
trunk/src/core/net/sf/basedb/util/overview/loader/BasicItemNodeLoaderFactory.java
r7004 r7461 123 123 Register a node loader implementation. The implementation must have a 124 124 public no-argument constructor. The given class is checked with 125 {@link ClassUtil#checkAndLoadClass(ClassLoader, String, boolean, Class ...)}125 {@link ClassUtil#checkAndLoadClass(ClassLoader, String, boolean, Class, Class...)} 126 126 127 127 @param key The item type the node loader handles -
trunk/src/core/net/sf/basedb/util/overview/validator/BasicItemNodeValidatorFactory.java
r7005 r7461 149 149 Register a node validator implementation. The implementation must have a 150 150 public no-argument constructor. The given class is checked with 151 {@link ClassUtil#checkAndLoadClass(ClassLoader, String, boolean, Class ...)}151 {@link ClassUtil#checkAndLoadClass(ClassLoader, String, boolean, Class, Class...)} 152 152 153 153 @param key The item type the node validator handles -
trunk/www/lims/arrayslides/wizard.js
r7439 r7461 118 118 var frm = document.forms['WizardStep2']; 119 119 var quantity = parseInt(frm.quantity.value); 120 for ( i = 0; i < quantity; i++)120 for (var i = 0; i < quantity; i++) 121 121 { 122 122 var name = frm['name'+i];
Note: See TracChangeset
for help on using the changeset viewer.