aspose file tools*
The moose likes Other Languages and the fly likes can you explain Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Languages » Other Languages
Bookmark "can you explain" Watch "can you explain" New topic
Author

can you explain

spars anu
Greenhorn

Joined: May 26, 2011
Posts: 11
public NoteEntity CreatePlayerNote(NoteEntity note)
{
IsolationLevel isolationLevel = IsolationLevel.ReadCommitted;
if (note.NoteType == NoteType.ALERT)
{
isolationLevel = IsolationLevel.Serializable;
}

Execute(delegate(ISession session, ITransaction transaction)
{
if (note.NoteType == NoteType.ALERT)
{
ICriteria select = session.CreateCriteria(typeof(NoteEntity)).Add(Expression.Eq("PlayerIx", note.PlayerIx))
.Add(Expression.Eq("NoteType", (Int32)note.NoteType));

var oldNote = select.UniqueResult<NoteEntity>();

if (oldNote != null)
{
oldNote.ActionDescription = "Alert changed from [" + oldNote.Text + "] to [" + note.Text + "] by AdminIx [" + note.AdminIx + "]";
oldNote.NoteType = NoteType.PLAYER_NOTE;
session.Update(oldNote);
}
}

session.Save(note);

}, isolationLevel);

return note;
}
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: can you explain