public class NoteItemObjectHandler
extends java.lang.Object
History Note:
2009: In a wide range we're using Hibernate now due to problems of iBatis
with AXIS2 regarding the XML parsing. To handle firebird BLOBs we're using
some additional methods...
2013: We're using Hibernate and native JDBC, it works well ;)
Constructor and Description |
---|
NoteItemObjectHandler(java.sql.Connection con)
Processing NoteItem objects using native JDBC.
|
NoteItemObjectHandler(SEHRDataSource fbds)
Processing NoteItem objects using SEHRDataSource object.
|
Modifier and Type | Method and Description |
---|---|
int |
count(int usrid,
boolean isread) |
NoteItem |
getItemFromNotePosts(org.ifeth.sehr.intrasec.entities.NotePosts post)
Get NoteItem object from given NOTE_POSTS record entity.
|
boolean |
putItemToNotePosts(NoteItem item,
org.ifeth.sehr.intrasec.entities.NotePosts post)
Get NoteItem object of current post record object.
|
NoteItem |
readNote(int postid)
Get a single NoteItem from the note posts table.
|
java.util.List<NoteItem> |
readNoteComments(int noteid)
Get notes as list by track for current NotePost object as parent.
|
java.util.List<NoteItem> |
readNotesByDate(java.sql.Date from,
java.sql.Date to)
Get note infos as List between 'from creation dt'
|
java.util.List<NoteItem> |
readNotesByDate(java.lang.String from,
java.lang.String to,
java.util.Locale locale)
Get notes by date range.
|
boolean |
rewriteNotePostsEntity(NoteItem item,
org.ifeth.sehr.intrasec.entities.NotePosts entity,
int usrid)
This is an helper method for preparing a NoteItem object to a NotePosts
object to store notes as posts by the IntraSEC db.
|
int |
saveNote(NoteItem note,
int usrid)
Save / Create given note as record in table NOTE_POSTS.
|
boolean |
updateNote(NoteItem item,
int usrid)
Update given NoteItem
Remember that this updates the NoteItem object identified by the EntryID.
|
public NoteItemObjectHandler(SEHRDataSource fbds)
fbds
- public NoteItemObjectHandler(java.sql.Connection con)
con
- public java.util.List<NoteItem> readNoteComments(int noteid)
Note:
The NoteItem BLOB db field is note parsed here. We're assuming the record
is stored by saveNote(org.ifeth.sehr.core.objects.NoteItem, int)
where the relevant data for lists and forms are extracted from the NoteItem
object and stored in the corresponding fields of the record.
Example:
NoteItemObjectHandler nioh = new NoteItemObjectHandler([con]);
List l = nioh.readNoteComments(1);
public java.util.List<NoteItem> readNotesByDate(java.lang.String from, java.lang.String to, java.util.Locale locale)
Note:
The NoteItem BLOB db field is note parsed here. We're assuming the record
is stored by saveNote(org.ifeth.sehr.core.objects.NoteItem, int)
where the relevant data for lists and forms are extracted from the NoteItem
object and stored in the corresponding fields of the record.
Example:
NoteItemObjectHandler np = new NoteItemObjectHandler();
List l =
np.getNotesAsPostList("1.1.2005","1.3.2005",Locale.GERMANY);
or
List l = np.getNotesAsPostList("2005/02/01","2005/07/01",Locale.US);
from
- to
- locale
- public java.util.List<NoteItem> readNotesByDate(java.sql.Date from, java.sql.Date to)
from
- to
- public NoteItem readNote(int postid)
postid
- public int saveNote(NoteItem note, int usrid) throws DataAccessException
note
- usrid
- the user the note is assigned to; -1 = public, all usersDataAccessException
public boolean updateNote(NoteItem item, int usrid) throws DataAccessException
Remember that this updates the NoteItem object identified by the EntryID. This property was set by the 'readNote' method.
DataAccessException
public NoteItem getItemFromNotePosts(org.ifeth.sehr.intrasec.entities.NotePosts post)
post
- public boolean putItemToNotePosts(NoteItem item, org.ifeth.sehr.intrasec.entities.NotePosts post)
item
- post
- public boolean rewriteNotePostsEntity(NoteItem item, org.ifeth.sehr.intrasec.entities.NotePosts entity, int usrid)
This method creates a NOTE_POSTS entity object by the properties of the given NoteItem object.
item
- usrid
- assign the post to a user; -1 all/publicNoteItem
public int count(int usrid, boolean isread)