Java Code Examples for org.hibernate.Hibernate#STRING

The following examples show how to use org.hibernate.Hibernate#STRING . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
public Type getDataType() {
	switch ( getType() ) {
		case NUM_INT:
			return Hibernate.INTEGER;
		case NUM_FLOAT:
			return Hibernate.FLOAT;
		case NUM_LONG:
			return Hibernate.LONG;
		case NUM_DOUBLE:
			return Hibernate.DOUBLE;
		case QUOTED_STRING:
			return Hibernate.STRING;
		case TRUE:
		case FALSE:
			return Hibernate.BOOLEAN;
		default:
			return null;
	}
}
 
Example 2
Source Project: olat   File: UserRatingsDaoImpl.java    License: Apache License 2.0 6 votes vote down vote up
/**
*/
  @Override
  public int deleteAllRatings(OLATResourceable olatResourceable, String resourceableSubPath) {
      String query;
      Object[] values;
      Type[] types;
      // special query when sub path is null
      if (resourceableSubPath == null) {
          query = "from UserRatingImpl where resName=? AND resId=? AND resSubPath is NULL";
          values = new Object[] { olatResourceable.getResourceableTypeName(), olatResourceable.getResourceableId() };
          types = new Type[] { Hibernate.STRING, Hibernate.LONG };
      } else {
          query = "from UserRatingImpl where resName=? AND resId=? AND resSubPath=?";
          values = new Object[] { olatResourceable.getResourceableTypeName(), olatResourceable.getResourceableId(), resourceableSubPath };
          types = new Type[] { Hibernate.STRING, Hibernate.LONG, Hibernate.STRING };
      }
      return database.delete(query, values, types);
  }
 
Example 3
Source Project: olat   File: UserCommentsDaoImpl.java    License: Apache License 2.0 6 votes vote down vote up
/**
*/
  public int deleteAllComments(OLATResourceable olatResourceable, String resourceableSubPath) {
      String query;
      Object[] values;
      Type[] types;
      // special query when sub path is null
      if (resourceableSubPath == null) {
          query = "from UserCommentImpl where resName=? AND resId=? AND resSubPath is NULL";
          values = new Object[] { olatResourceable.getResourceableTypeName(), olatResourceable.getResourceableId() };
          types = new Type[] { Hibernate.STRING, Hibernate.LONG };
      } else {
          query = "from UserCommentImpl where resName=? AND resId=? AND resSubPath=?";
          values = new Object[] { olatResourceable.getResourceableTypeName(), olatResourceable.getResourceableId(), resourceableSubPath };
          types = new Type[] { Hibernate.STRING, Hibernate.LONG, Hibernate.STRING };
      }
      return db.delete(query, values, types);
  }
 
Example 4
Source Project: olat   File: UserRatingsDaoImpl.java    License: Apache License 2.0 6 votes vote down vote up
/**
*/
  @Override
  public int deleteAllRatings(OLATResourceable olatResourceable, String resourceableSubPath) {
      String query;
      Object[] values;
      Type[] types;
      // special query when sub path is null
      if (resourceableSubPath == null) {
          query = "from UserRatingImpl where resName=? AND resId=? AND resSubPath is NULL";
          values = new Object[] { olatResourceable.getResourceableTypeName(), olatResourceable.getResourceableId() };
          types = new Type[] { Hibernate.STRING, Hibernate.LONG };
      } else {
          query = "from UserRatingImpl where resName=? AND resId=? AND resSubPath=?";
          values = new Object[] { olatResourceable.getResourceableTypeName(), olatResourceable.getResourceableId(), resourceableSubPath };
          types = new Type[] { Hibernate.STRING, Hibernate.LONG, Hibernate.STRING };
      }
      return database.delete(query, values, types);
  }
 
Example 5
Source Project: olat   File: UserCommentsDaoImpl.java    License: Apache License 2.0 6 votes vote down vote up
/**
*/
  public int deleteAllComments(OLATResourceable olatResourceable, String resourceableSubPath) {
      String query;
      Object[] values;
      Type[] types;
      // special query when sub path is null
      if (resourceableSubPath == null) {
          query = "from UserCommentImpl where resName=? AND resId=? AND resSubPath is NULL";
          values = new Object[] { olatResourceable.getResourceableTypeName(), olatResourceable.getResourceableId() };
          types = new Type[] { Hibernate.STRING, Hibernate.LONG };
      } else {
          query = "from UserCommentImpl where resName=? AND resId=? AND resSubPath=?";
          values = new Object[] { olatResourceable.getResourceableTypeName(), olatResourceable.getResourceableId(), resourceableSubPath };
          types = new Type[] { Hibernate.STRING, Hibernate.LONG, Hibernate.STRING };
      }
      return db.delete(query, values, types);
  }
 
Example 6
Source Project: olat   File: UserRatingsDaoImpl.java    License: Apache License 2.0 5 votes vote down vote up
/**
*/
  @Override
  public int deleteAllRatingsIgnoringSubPath(OLATResourceable olatResourceable) {
      // Don't limit to subpath. Ignore if null or not, just delete on the resource
      String query = "from UserRatingImpl where resName=? AND resId=?";
      Object[] values = new Object[] { olatResourceable.getResourceableTypeName(), olatResourceable.getResourceableId() };
      Type[] types = new Type[] { Hibernate.STRING, Hibernate.LONG };
      return database.delete(query, values, types);
  }
 
Example 7
Source Project: olat   File: UserCommentsDaoImpl.java    License: Apache License 2.0 5 votes vote down vote up
/**
*/
  public int deleteAllCommentsIgnoringSubPath(OLATResourceable olatResourceable) {
      // Don't limit to subpath. Ignore if null or not, just delete on the resource
      String query = "from UserCommentImpl where resName=? AND resId=?";
      Object[] values = new Object[] { olatResourceable.getResourceableTypeName(), olatResourceable.getResourceableId() };
      Type[] types = new Type[] { Hibernate.STRING, Hibernate.LONG };
      return db.delete(query, values, types);
  }
 
Example 8
Source Project: olat   File: UserRatingsDaoImpl.java    License: Apache License 2.0 5 votes vote down vote up
/**
*/
  @Override
  public int deleteAllRatingsIgnoringSubPath(OLATResourceable olatResourceable) {
      // Don't limit to subpath. Ignore if null or not, just delete on the resource
      String query = "from UserRatingImpl where resName=? AND resId=?";
      Object[] values = new Object[] { olatResourceable.getResourceableTypeName(), olatResourceable.getResourceableId() };
      Type[] types = new Type[] { Hibernate.STRING, Hibernate.LONG };
      return database.delete(query, values, types);
  }
 
Example 9
Source Project: olat   File: UserCommentsDaoImpl.java    License: Apache License 2.0 5 votes vote down vote up
/**
*/
  public int deleteAllCommentsIgnoringSubPath(OLATResourceable olatResourceable) {
      // Don't limit to subpath. Ignore if null or not, just delete on the resource
      String query = "from UserCommentImpl where resName=? AND resId=?";
      Object[] values = new Object[] { olatResourceable.getResourceableTypeName(), olatResourceable.getResourceableId() };
      Type[] types = new Type[] { Hibernate.STRING, Hibernate.LONG };
      return db.delete(query, values, types);
  }
 
Example 10
public Type getReturnType(Type columnType, Mapping mapping) throws QueryException {
	return Hibernate.STRING;
}
 
Example 11
public Type getReturnType(Type columnType, Mapping mapping) throws QueryException {
	return Hibernate.STRING;
}
 
Example 12
public Type getReturnType(Type columnType, Mapping mapping) throws QueryException {
	return Hibernate.STRING;
}
 
Example 13
public AnyType() {
	this(Hibernate.STRING, Hibernate.SERIALIZABLE);
}
 
Example 14
public Type[] getPropertyTypes() {
	return new Type[] { Hibernate.STRING, Hibernate.STRING };
}
 
Example 15
/**
 * @see EntityPersister#getIdentifierType()
 */
public Type getIdentifierType() {
	return Hibernate.STRING;
}