Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Creative commons Attribution-NonCommercial license. http://creativecommons.org/licenses/by-nc/2.5/au/deed.en_GB NO WARRANTY IS GIVEN OR IMPLIED, USE AT YOUR OWN RISK.
 
 package base.jee.api.cassandra.util;
 
import static base.jee.api.cassandra.util.Log.log;
public class UpsertGroup {
	public static UUID upsertGroup(Session sString groupint typeUser updator) {
		UUID uuid = new base.uuid.UUID().toJavaUUID();
		PreparedStatement p = s.prepare("select name from base_group where name = ?");
		ResultSet r = s.execute(p.bind(group));
		if(!r.iterator().hasNext()) {
			p = s.prepare("insert into base_group (uuid, name, type) values(?,?,?)");
			s.execute(p.bind(uuidgrouptype));
			log(s"INFO"updator"Added group \"" + Json.escape(group) + "\""new ResourceUid("Person"updator.getPersonUuid().toString()), new ResourceUid("Group"uuid));
			return uuid;
		}
		return null;
	}
New to GrepCode? Check out our FAQ X