* @return an ODocument instance representing the collection
* @throws CollectionAlreadyExistsException
* @throws OpenTransactionException, CollectionAlreadyExistsException, InvalidCollectionException, InvalidModelException, Throwable
*/
public ODocument create(String collectionName) throws OpenTransactionException, CollectionAlreadyExistsException, InvalidCollectionException, InvalidModelException, Throwable {
if (DbHelper.isInTransaction()) throw new OpenTransactionException("Cannot create a collection within an open transaction");
if (Logger.isTraceEnabled()) Logger.trace("Method Start");
try {
if (existsCollection(collectionName)) throw new CollectionAlreadyExistsException("Collection " + collectionName + " already exists");
}catch (SqlInjectionException e){
throw new InvalidCollectionException(e);