Changeset 7638
- Timestamp:
- Mar 11, 2019, 12:51:33 PM (3 years ago)
- Location:
- trunk/src
- Files:
-
- 4 deleted
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/clients/web/net/sf/basedb/clients/web/PermissionUtil.java
r7511 r7638 162 162 All items which permissions depend on some other item only. 163 163 */ 164 @SuppressWarnings("deprecation")165 164 private static final Set<Item> ignored = EnumSet.of( 166 165 Item.SYSTEM, Item.HELP, … … 170 169 Item.PLATEEVENT, Item.PLATEEVENTTYPE, Item.WELL, 171 170 Item.ARRAYDESIGNBLOCK, Item.FEATURE, Item.ARRAYDESIGNPLATE, 172 Item. SPOTIMAGES, Item.RAWDATA,171 Item.RAWDATA, 173 172 Item.BIOASSAYSET, Item.BIOASSAY, Item.TRANSFORMATION, Item.EXTRAVALUE, 174 173 Item.VIRTUALDB, Item.DATACUBE, Item.DATACUBELAYER, Item.DATACUBECOLUMN, Item.DATACUBEFILTER, -
trunk/src/core/common-queries.xml
r7408 r7638 925 925 </query> 926 926 927 <query id="GET_SPOTIMAGES_FOR_FILE" type="HQL">928 <sql>929 SELECT {1}930 FROM SpotImagesData spi931 WHERE spi.redImageFile = :file932 OR spi.greenImageFile = :file933 OR spi.blueImageFile = :file934 OR spi.spotImagesFile = :file935 </sql>936 <description>937 A Hibernate query that gets spot images where a given938 file is used as one of the color components or holds the generated spot images.939 </description>940 </query>941 942 927 <query id="GET_FILESETMEMBERS_FOR_FILE" type="HQL"> 943 928 <sql> -
trunk/src/core/net/sf/basedb/core/File.java
r7623 r7638 550 550 used = HibernateUtil.loadData(query2) > 0; 551 551 } 552 if (!used)553 {554 org.hibernate.query.Query<Long> query2 = HibernateUtil.getPredefinedQuery(session,555 "GET_SPOTIMAGES_FOR_FILE", Long.class, "count(*)");556 /*557 SELECT {1}558 FROM SpotImagesData spi559 WHERE spi.redImageFile = :file560 OR spi.greenImageFile = :file561 OR spi.blueImageFile = :file562 OR spi.spotImagesFile = :file563 */564 query2.setParameter("file", getId(), TypeWrapper.H_INTEGER);565 used = HibernateUtil.loadData(query2) > 0;566 }567 552 return used || super.isUsed(); 568 553 } … … 571 556 <ul> 572 557 <li>{@link FileAttachable} items with this file attached 573 <li>{@link SpotImages} using this file574 558 </ul> 575 559 @since 2.2 576 560 */ 577 @SuppressWarnings("deprecation")578 561 @Override 579 562 public Set<ItemProxy> getUsingItems() … … 616 599 } 617 600 618 // SpotImages619 org.hibernate.query.Query<Integer> query3 = HibernateUtil.getPredefinedQuery(session,620 "GET_SPOTIMAGES_FOR_FILE", Integer.class, "spi.id");621 /*622 SELECT {1}623 FROM SpotImagesData spi624 WHERE spi.redImageFile = :file625 OR spi.greenImageFile = :file626 OR spi.blueImageFile = :file627 OR spi.spotImagesFile = :file628 */629 query3.setParameter("file", getId(), TypeWrapper.H_INTEGER);630 addUsingItems(using, Item.SPOTIMAGES, query3);631 632 601 return using; 633 602 } -
trunk/src/core/net/sf/basedb/core/Install.java
r7615 r7638 119 119 method. 120 120 */ 121 public static final int NEW_SCHEMA_VERSION = Integer.valueOf(14 5).intValue();121 public static final int NEW_SCHEMA_VERSION = Integer.valueOf(147).intValue(); 122 122 123 123 public static synchronized int createTables(SchemaGenerator.Mode mode, ProgressReporter progress, -
trunk/src/core/net/sf/basedb/core/Item.java
r7610 r7638 503 503 300), 504 504 505 /**506 The item is a {@link SpotImages}.507 @deprecated In 3.14, will be removed in the future without replacement508 */509 @Deprecated510 SPOTIMAGES(265, "Spot images", "spi", SpotImages.class, SpotImagesData.class, null,511 310),512 505 /** 513 506 The item is a {@link RawData} spot. -
trunk/src/core/net/sf/basedb/core/RawBioAssay.java
r7511 r7638 31 31 import net.sf.basedb.core.data.ReporterData; 32 32 import net.sf.basedb.core.data.SoftwareData; 33 import net.sf.basedb.core.data.SpotImagesData;34 33 import net.sf.basedb.core.hibernate.TypeWrapper; 35 34 import net.sf.basedb.core.query.Restrictions; … … 924 923 } 925 924 926 /**927 Get the {@link SpotImages} item used to generate spot images928 for this raw bioassay. If no <code>SpotImages</code> exists929 a new one is created, and is automatically saved to the database (if930 commit is called).931 932 @return The <code>SpotImages</code> item933 @throws PermissionDeniedException If logged in user doesn't have read permission to the spot images.934 @throws BaseException If there is some kind of error.935 @see #hasSpotImages()936 @deprecated In 3.14, will be removed in the future without replacement937 */938 @Deprecated939 public SpotImages getSpotImages()940 throws PermissionDeniedException, BaseException941 {942 SpotImagesData spi = getData().getSpotImages();943 SpotImages spotImages = null;944 if (spi == null)945 {946 spotImages = SpotImages.getNew(getDbControl(), this);947 getDbControl().saveItemIf(this, spotImages, false);948 }949 else950 {951 spotImages = getDbControl().getItem(SpotImages.class, spi);952 }953 return spotImages;954 }955 956 /**957 Check if spot images exists for this raw bioassay or not.958 @see #getSpotImages()959 @deprecated In 3.14, will be removed in the future without replacement960 */961 @Deprecated962 public boolean hasSpotImages()963 {964 return getData().getSpotImages() != null;965 }966 967 925 /** 968 926 Get the value for the raw data header with the specified name. -
trunk/src/core/net/sf/basedb/core/Update.java
r7637 r7638 704 704 } 705 705 706 if (schemaVersion < 14 6)707 { 708 if (progress != null) progress.display((int)(progress_current), "--Updating schema version: " + schemaVersion + " -> 14 6...");709 schemaVersion = updateToSchemaVersion14 6(session, schemaVersion);706 if (schemaVersion < 147) 707 { 708 if (progress != null) progress.display((int)(progress_current), "--Updating schema version: " + schemaVersion + " -> 147..."); 709 schemaVersion = updateToSchemaVersion147(session, schemaVersion); 710 710 progress_current += progress_step; 711 711 } … … 2189 2189 /** 2190 2190 2191 @return The new schema version (=14 6)2191 @return The new schema version (=147) 2192 2192 */ 2193 private static int updateToSchemaVersion14 6(org.hibernate.Session session, int currentSchemaVersion)2193 private static int updateToSchemaVersion147(org.hibernate.Session session, int currentSchemaVersion) 2194 2194 throws BaseException 2195 2195 { 2196 final int schemaVersion = 146; 2197 org.hibernate.Transaction tx = null; 2198 2199 try 2200 { 2201 tx = HibernateUtil.newTransaction(session); 2202 2203 org.hibernate.query.Query<?> query = HibernateUtil.createQuery(session, 2204 "UPDATE PluginDefinitionData " + 2205 "SET disabled = true, name = CONCAT(name, ' (deprecated)') " + 2206 "WHERE className='net.sf.basedb.plugins.SpotImageCreator'"); 2207 query.executeUpdate(); 2196 final int schemaVersion = 147; 2197 try 2198 { 2199 2200 if (currentSchemaVersion < 146) 2201 { 2202 // First step is to update existing information 2203 org.hibernate.Transaction tx = null; 2204 try 2205 { 2206 tx = HibernateUtil.newTransaction(session); 2207 2208 org.hibernate.query.Query<?> query = HibernateUtil.createQuery(session, 2209 "UPDATE PluginDefinitionData " + 2210 "SET disabled = true, name = CONCAT(name, ' (deprecated)') " + 2211 "WHERE className='net.sf.basedb.plugins.SpotImageCreator'"); 2212 query.executeUpdate(); 2213 2214 setSchemaVersion(session, 146); 2215 2216 // Commit the changes 2217 HibernateUtil.commit(tx); 2218 } 2219 finally 2220 { 2221 if (tx != null && tx.getStatus() != TransactionStatus.COMMITTED) HibernateUtil.rollback(tx); 2222 } 2223 } 2224 2225 // Drop the 'SpotImages' table 2226 dropTable(session, "SpotImages"); 2208 2227 2209 2228 // Update the schema version number 2210 // setSchemaVersionInTransaction(session, schemaVersion); 2211 2212 // Commit the changes 2213 HibernateUtil.commit(tx); 2214 log.info("updateToSchemaVersion146: OK"); 2229 setSchemaVersionInTransaction(session, schemaVersion); 2230 2231 log.info("updateToSchemaVersion147: OK"); 2215 2232 } 2216 2233 catch (RuntimeException ex) 2217 2234 { 2218 if (tx != null) HibernateUtil.rollback(tx); 2219 log.error("updateToSchemaVersion146: FAILED", ex); 2235 log.error("updateToSchemaVersion147: FAILED", ex); 2220 2236 throw ex; 2221 2237 } 2222 2238 return schemaVersion; 2223 2224 2239 } 2225 2240 -
trunk/src/core/net/sf/basedb/core/data/RawBioAssayData.java
r6908 r7638 189 189 } 190 190 191 private SpotImagesData spotImages;192 /**193 Get the settings used for generating spot images for this raw bio assay.194 @hibernate.one-to-one property-ref="rawBioAssay" cascade="delete"195 */196 public SpotImagesData getSpotImages()197 {198 return spotImages;199 }200 void setSpotImages(SpotImagesData spotImages)201 {202 this.spotImages = spotImages;203 }204 205 191 private DerivedBioAssayData bioAssay; 206 192 /**
Note: See TracChangeset
for help on using the changeset viewer.