Changeset 5054
- Timestamp:
- Aug 18, 2009, 1:24:48 PM (14 years ago)
- Location:
- trunk/src/core
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/common-queries.xml
r5039 r5054 3532 3532 </description> 3533 3533 </query> 3534 3534 <query id="DBLOG_GET_ANNOTATIONTYPE_NAME" type="HQL"> 3535 <sql> 3536 SELECT at.name 3537 FROM AnnotationTypeData at 3538 WHERE at.id = :annotationTypeId 3539 </sql> 3540 <description> 3541 An HQL query that loads the name of an annotation type 3542 given the ID. 3543 </description> 3544 </query> 3545 <query id="DBLOG_GET_ANNOTATION_ITEMTYPE" type="HQL"> 3546 <sql> 3547 SELECT as.itemType 3548 FROM AnnotationSetData as 3549 WHERE as.id = :annotationSetId 3550 </sql> 3551 <description> 3552 An HQL query that loads the item type value an annotation 3553 set with a given ID belongs to. 3554 </description> 3555 </query> 3556 <query id="DBLOG_GET_ITEMID_WITH_ANNOTATION" type="HQL"> 3557 <sql> 3558 SELECT i.id 3559 FROM {1} i 3560 WHERE i.annotationSet = :annotationSetId 3561 </sql> 3562 <description> 3563 An HQL query that loads the ID of the item that 3564 is associated with a given annotation set. 3565 </description> 3566 </query> 3567 3535 3568 </predefined-queries> -
trunk/src/core/net/sf/basedb/core/LogControl.java
r5038 r5054 83 83 } 84 84 85 /** 86 Creates a Hibernate HQL query. Use this to get information 87 from the database that is relevent for the logging implementation. 88 The query uses the stateless session, which means that there 89 is no first- or second-level cache and on support for initialization 90 of proxies. We recommend that queries are used to return 91 scalar values only, not entities. 92 @return A Query 93 */ 94 public org.hibernate.Query createHqlQuery(String hql) 95 { 96 return HibernateUtil.createQuery(getSession(), hql); 97 } 98 99 /** 100 Creates a Hibernate SQL query. Use this to get information 101 from the database that is relevent for the logging 102 implementation. The query uses the stateless session. 103 @return A query 104 */ 105 public org.hibernate.Query createSqlQuery(String sql) 106 { 107 return HibernateUtil.createSqlQuery(session, sql); 108 } 109 85 110 private org.hibernate.StatelessSession getSession() 86 111 { -
trunk/src/core/net/sf/basedb/core/PredefinedQuery.java
r4889 r5054 58 58 59 59 @author Nicklas 60 @version 2.0 60 @version 2.0, 2.13 (made public) 61 61 */ 62 class PredefinedQuery62 public class PredefinedQuery 63 63 { 64 64 … … 134 134 /** 135 135 Get the query string for the predefined query with 136 the specified name. 136 the specified name. This method was made public in BASE 2.13. 137 137 @throws BaseException If the query is not found or there 138 138 is any other error 139 @since 2.13 139 140 */ 140 static String getQueryString(String name, String... replacements)141 public static String getQueryString(String name, String... replacements) 141 142 throws BaseException 142 143 { -
trunk/src/core/net/sf/basedb/core/data/AnnotationData.java
r4889 r5054 36 36 public class AnnotationData 37 37 extends BasicData 38 implements LoggableData 38 39 { 39 40 public AnnotationData() -
trunk/src/core/net/sf/basedb/core/log/ChangeType.java
r5038 r5054 32 32 { 33 33 34 CREATE(1 ),35 UPDATE(2 ),36 DELETE(3 );34 CREATE(1, "created"), 35 UPDATE(2, "updated"), 36 DELETE(3, "deleted"); 37 37 38 38 private final int value; 39 private ChangeType(int value) 39 private final String was; 40 41 private ChangeType(int value, String was) 40 42 { 41 43 this.value = value; 44 this.was = was; 42 45 } 43 46 … … 49 52 { 50 53 return value; 54 } 55 56 /** 57 Create a string for display purposes that explains what 58 has happened to the what. For example, if what is 'Annotation', 59 this method may return 'Annotation created'. 60 @param what The 'what' that something happened to 61 @return A string 62 */ 63 public String was(String what) 64 { 65 return what + " " + was; 51 66 } 52 67 -
trunk/src/core/net/sf/basedb/core/log/db/DbLogManagerFactory.java
r5052 r5054 27 27 import net.sf.basedb.core.Config; 28 28 import net.sf.basedb.core.LogControl; 29 import net.sf.basedb.core.data.AnnotationData; 29 30 import net.sf.basedb.core.data.BioMaterialEventData; 30 31 import net.sf.basedb.core.data.LoggableData; … … 56 57 this.defaultLogger = new DefaultEntityLogger(detailedProperties); 57 58 setSpecialLogger(BioMaterialEventData.class, new BioMaterialEventLogger(detailedProperties)); 58 //setSpecialLogger(AnnotationData.class, new AnnotationLogger());59 setSpecialLogger(AnnotationData.class, new AnnotationLogger()); 59 60 } 60 61
Note: See TracChangeset
for help on using the changeset viewer.