Moreno Cavallaro

+ Follow
since Oct 01, 2016
Moreno likes ...
Netbeans IDE Postgres Database Java
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Moreno Cavallaro

Dave Tolls wrote:.......
What does the database as a whole represent?

The real database I am (trying to) working on is about industrial refrigeration machines.
Machines are grouped by field of application, and they are very different from each other, sharing just few to none attributes, "image" is one of that.
So i have tables Condenser, Compressor and Evaporator. Each Condenser (or Evaporator or Compressor) can have one or more images, but those image(s) are just for that specific Condenser.
Now if I use multiple foreign keys in the Image Table, I will always have null fields. Is it a good/recommended practice or there is some better way to achieve what I need?
Sorry for the dumb questions but I am just a beginner, and sorry for my poor English.

Dave Tolls wrote:The image table wouldn't have the foreign keys.
Your car table (eg) would (assuming many-to-many) have a mapping table car_image with a pair of ids, mapping a car to an image for each row.

Hi Dave,
my needs was to have a one-to-many relation between car (or toy or pet) and images. Anyway if I understand correctly, in your example I should have something like this:

Bear Bibeault wrote:Why do you feel that multiple tables can't refer to the same image table?

My first thought was to do something like this:

But I am afraid that it could lead in a lot of null fields (the fk's), specially in case I need to add other entities with photos.

Hi all.
I need some help to understand the "best" way to design a database (Postgres) which stores multiple products with multiple images.
To be more clear I put an example:
I have a table for "car", one for "pet", another for "toy". Now I need to associate to each of that tables multiple images, and I  have no idea how to do it in a efficient way.
Do I have to create an image table for each of them, same as "car_image", "pet_image" and "toy_image" with a foreign key?
Or maybe is possible to have a single (generic) "image" table with multiple foreign keys?
Thanks for your help.
Ok, I found the way to solve my problem.
Just placing a dummy image as placeholder and replace with the ones I need with the class MutableCell, through the method setImage (of course from the Jopendocument library).
The only adjustment I had to do was to anchor the dummy image to the cell and not to the page.
3 years ago
Hi all,
this is my first post, so I need to apologise if I will do some mistake and because of my poor English.
I need to know if someone has experience in LibreOffice Calc files manipulation through some Java API.
I know there is Jopendocument which can do a great job for quite every task required, but my need is to "embed" a picture, or more (jpg, png etc.) in a LibreOffice spreadsheet at a specific location.
I have no code to post because I simply didn't find any resource in internet yet.
Thanks and compliments for the great community here.
3 years ago