Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6885125
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:35:44+00:00 2026-05-27T05:35:44+00:00

With pms-mlx , I’ve been working on a media library to extend the functionalities

  • 0

With pms-mlx, I’ve been working on a media library to extend the functionalities of the ps3 media server for some time now and just recently discovered a major flow in my concept; it is not possible to filter if using more than one one-to-many property.

Before asking questions, I should explain how it works.
Here’s the DB structure for the relevant part of the code. h2 is being used.
DB schema video
Every video is a file and has 0-n of the attached properties.

Once some videos have been stored, it is possible to view and play them in folders showing only a subset of all entries, by setting conditions. Here’s an example:
pms-mlx condition example

To retrieve the wanted files, the query is being constructed like this

SELECT <all_properties> 
FROM FILE, VIDEO
LEFT JOIN VIDEOAUDIO ON VIDEO.FILEID = VIDEOAUDIO.FILEID
LEFT JOIN SUBTITLES ON VIDEO.FILEID = SUBTITLES.FILEID
LEFT JOIN FILETAGS ON VIDEO.FILEID = FILETAGS.FILEID
LEFT JOIN FILEPLAYS ON VIDEO.FILEID = FILEPLAYS.FILEID
WHERE <whereClause>
ORDER BY <orderBy>

Only the where and order by parts are dynamic. The where clause is being created by replacing the condition names (c1, c2) by their corresponding SQL counterparts. For the above example this where clause will be generated:

WHERE VIDEO.FILEID = FILE.ID 
  AND ((VIDEO.NAME LIKE 'A%' OR VIDEO.NAME LIKE 'B%') 
  AND FILE.DATEINSERTEDDB > '2011-09-28 18:48:43')

When doing the query, many rows will be returned for each file. While iterating through the results, the ‘new’ data contained in the raw will be added to create the object.

When the filter contains a one-to-many condition, the query is being done in two steps. First, the IDs of all the videos are being retrieved and then the data loaded.

What I’ve been missing until now, is that if having e.g. two file tags and both should be met, nothing works anymore.
If setting the filter:
not working filter example
Resulting in this where clause:

WHERE VIDEO.FILEID = FILE.ID 
  AND ((VIDEO.FILEID = FILETAGS.FILEID 
    AND FILETAGS.KEY = 'Actor' AND FILETAGS.VALUE LIKE 'A%') 
  AND (VIDEO.FILEID = FILETAGS.FILEID 
    AND FILETAGS.KEY = 'Actor' AND FILETAGS.VALUE LIKE 'B%'))

which is never met, as a single row only contains one key and one value field.

Would it be possible to create a query where all the data for a single video would be contained on one row? Or substitute the generated SQL condition by something else?
I’m no db expert and would love to here from someone having a good idea 🙂

The code to generate the where clause is in the method formatFilter on line 445 of DBFileInfo.java. The loading of the data is being done on line 189 of DBVideoFileInfo.java if anybody is interested to see the code.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T05:35:45+00:00Added an answer on May 27, 2026 at 5:35 am

    Your complex table relationships is a bit confusing for a simple example of the problem, but can you not just build a bunch of criteria up?

    WHERE FILEID IN (SELECT [all files that have brad])
    AND FILEID IN (SELECT [all files that have angelina])
    AND FILEID IN (SELECT [all files that have elvis])
    

    Surely that would only return files that have Brad, Angelina and Elvis in? (Probably not many).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason, I can't get filehandles working with Expect.pm's log_file method. I originally
I have a PMS(Pantone Matching System) color value. I need to find the corresponding
Master page HTML : <%@ Master Language=VB AutoEventWireup=false CodeBehind=PMS.master.vb Inherits=PMS.PMS %> <%@ Register Assembly=AjaxControlToolkit
Alright, so here's the dealio: I'm working on a Ruby app that'll take data
When i am going to save multiple record at that time i am getting
I need to do some quick-and-dirty Perl GUI building. I can't afford a Komodo
I have a database with a lot of private messages (PMs). PMs can be
I created one yml file $loader = sfYaml::load('/pms/config/org.yml'); print_r($loader); I have values in the
I have a PrivateMessage class and I want to get list of PMs for
guys i need to count new private messages and old one from a table

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.