A topic started in a forum, ie the opening post of a discussion thread. It is a kind of Post, so the author, date, body text in notes and vote total come from there, and what it adds is the owning forum plus a name and title of its own. Replies to the topic are ForumReply rows, and a reply can itself have a parent reply so discussions nest. Deletion is soft, using the inherited deleted flag, and the finders and the reply count skip flagged rows.

Group: Database Entities

Extends: Post

Implements: Serializable


Properties

PropertyReturnsDescription
forumForumForum this topic was started in, which in turn determines the website it appears on. Never null.
forumReplysList<ForumReply>Replies posted to this topic. This is the raw mapped collection, so it includes soft-deleted replies and it is lazily loaded; getNumReplies gives the count with deleted ones excluded.
nameStringPath-safe identifier for the topic, unique within its forum and used as the last part of the topic's URL. Never null. Use getTitle for the text shown to members.
numReplieslongNumber of replies to this topic that have not been soft deleted. Reads the whole reply collection to count them, so it will trigger a lazy load the first time it is called.
titleStringSubject line of the topic as typed by the member who started it. Free text with no uniqueness guarantee. Never null.

Inherited from Post

Properties

PropertyReturnsDescription
adminDomainOrganisationAdministering organisation the post belongs to, used to scope moderation and reporting to one account. May be null on older rows created before it was recorded.
deletedBooleanSoft-delete flag. When true the post is hidden from listings but its row is kept. Null on posts that have never been deleted, so prefer isDeleted for a null-safe check.
idlongUnique database identifier for this post, shared across the whole post hierarchy.
notesStringThe body of the post, ie what the member actually wrote, up to 20000 characters. May be null.
numReportsintNumber of abuse reports against this post, or zero if there are none. Reads the reports collection, so it will trigger a lazy load the first time it is called.
parentPostPost this one is a reply to, which is what makes comment and forum threads nest. Null for a top level post.
postDateDateExact time the post was made. Listings order by this, most recent first. Never null.
postDayDateThe post date truncated to a day, stored separately so posts can be grouped and counted by day without date arithmetic in the query. It is set by the code creating the post, not derived automatically.
posterProfileProfile of the member who wrote the post. Null for an anonymous comment, in which case the commenter's details are on the comment itself.
postReportsList<PostReport>Abuse reports raised against this post by members. Lazily loaded, and may be null or empty when nobody has reported it.
relatedAppNameStringName of the app that generated this post, when it was created by a feature rather than typed by a member. Null for an ordinary member post, and posts with it set are excluded from a member's post count by default.
relatedIdStringIdentifier, meaningful to the related app, of the item this post was generated from. Read it together with the related app name. Null for an ordinary member post.
votesTotalIntegerCached sum of the counts of all votes on this post, so a score can be shown without counting the vote rows. Null on posts that have never been voted on.
websiteWebsiteWebsite the post was made on, copied onto the post so that posts can be listed per website without joining through the content or the forum. May be null for posts not tied to a website.

Methods

getId() · getAdminDomain() · getDeleted() · getWebsite() · getPoster() · getParent() · getPostDate() · getPostDay() · getNotes() · getPostReports() · getVotesTotal() · getRelatedAppName() · getRelatedId() · getNumReports() · findFiles() · isDeleted() · asComment() · asForumReply()

getId()

Returns: long

Unique database identifier for this post, shared across the whole post hierarchy.

getAdminDomain()

Returns: Organisation

Administering organisation the post belongs to, used to scope moderation and reporting to one account. May be null on older rows created before it was recorded.

getDeleted()

Returns: Boolean

Soft-delete flag. When true the post is hidden from listings but its row is kept. Null on posts that have never been deleted, so prefer isDeleted for a null-safe check.

getWebsite()

Returns: Website

Website the post was made on, copied onto the post so that posts can be listed per website without joining through the content or the forum. May be null for posts not tied to a website.

getPoster()

Returns: Profile

Profile of the member who wrote the post. Null for an anonymous comment, in which case the commenter's details are on the comment itself.

getParent()

Returns: Post

Post this one is a reply to, which is what makes comment and forum threads nest. Null for a top level post.

getPostDate()

Returns: Date

Exact time the post was made. Listings order by this, most recent first. Never null.

getPostDay()

Returns: Date

The post date truncated to a day, stored separately so posts can be grouped and counted by day without date arithmetic in the query. It is set by the code creating the post, not derived automatically.

getNotes()

Returns: String

The body of the post, ie what the member actually wrote, up to 20000 characters. May be null.

getPostReports()

Returns: List<PostReport>

Abuse reports raised against this post by members. Lazily loaded, and may be null or empty when nobody has reported it.

getVotesTotal()

Returns: Integer

Cached sum of the counts of all votes on this post, so a score can be shown without counting the vote rows. Null on posts that have never been voted on.

getRelatedAppName()

Returns: String

Name of the app that generated this post, when it was created by a feature rather than typed by a member. Null for an ordinary member post, and posts with it set are excluded from a member's post count by default.

getRelatedId()

Returns: String

Identifier, meaningful to the related app, of the item this post was generated from. Read it together with the related app name. Null for an ordinary member post.

getNumReports()

Returns: int

Number of abuse reports against this post, or zero if there are none. Reads the reports collection, so it will trigger a lazy load the first time it is called.

findFiles()

Returns: List<FileAttachment>

Loads the files attached to this post, using the current session. This queries the database, so hold on to the result rather than calling it repeatedly in a loop.

isDeleted()

Returns: boolean

Whether this post has been soft deleted, treating the null case as not deleted. Prefer this over getDeleted when all you want is a true or false answer.

asComment()

Returns: Comment

Returns this post as a comment, or null if it is not one. Lets script narrow a post from a mixed list without checking the type code first.

asForumReply()

Returns: ForumReply

Returns this post as a forum reply, or null if it is not one. Lets script narrow a post from a mixed list without checking the type code first.


Methods

getForum()

Returns: Forum

Forum this topic was started in, which in turn determines the website it appears on. Never null.

getName()

Returns: String

Path-safe identifier for the topic, unique within its forum and used as the last part of the topic's URL. Never null. Use getTitle for the text shown to members.

getTitle()

Returns: String

Subject line of the topic as typed by the member who started it. Free text with no uniqueness guarantee. Never null.

getForumReplys()

Returns: List<ForumReply>

Replies posted to this topic. This is the raw mapped collection, so it includes soft-deleted replies and it is lazily loaded; getNumReplies gives the count with deleted ones excluded.

getNumReplies()

Returns: long

Number of replies to this topic that have not been soft deleted. Reads the whole reply collection to count them, so it will trigger a lazy load the first time it is called.

postType()

Returns: String

Type code identifying this post as a forum topic, always the letters FP.

contentTitle()

Returns: String

Display label for this topic, which for a forum topic is simply its title.

asForumPost()

Returns: ForumPost

Returns this post as a forum topic. Useful from script when working with a list of posts, since the same method on other post types returns null.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.