How to save an entity with description and a file?

Hi everybody!
I have an entity Video:
@Entity
public class Video {
@PrimaryKey
private String title;
@SecondaryKey(relate = MANY_TO_ONE, relatedEntity=Journalist.class)
private String jorName;
@SecondaryKey(relate = MANY_TO_ONE, relatedEntity=Operator.class)
private String oName;
@SecondaryKey(relate = MANY_TO_ONE)
private Date date;
@SecondaryKey(relate = MANY_TO_ONE)
private String place;
private File file;
the video accesor for PK is:
PrimaryIndex<String,Video> pIdx=store.getPrimaryIndex(String.class, Video.class);
A user opens a form(it is written in swing) and fills in the title, name of the author, date, place of the video and browsers a file from some source. Now the user presses button "upload" and the whole object must be put to database. I dont understand how the whole object(file with filled description) can be put to db?
Below is actionPerformed function:
public void actionPerformed(ActionEvent e) {
Object source = e.getSource();
if (e.getSource() == btnBrowse) {
int returnVal = fc.showOpenDialog(VideoPanel.this);
if (returnVal == JFileChooser.APPROVE_OPTION) {
File file = fc.getSelectedFile();
textField.setText(file.toString());
if(source == btnUpload){
if(text1.getText().equals("")&&text2.getText().equals("")&&text3.getText().equals("")){
//how to put the whole object?
Thanks in advance!

Hello,
I dont understand how the whole object(file with filled description) can be put to db?Have you read the documentation and examples about how to use the com.sleepycat.persist API to write and read persistent objects? If so, what specifically is confusing? Be sure to look at the example programs.
We can help with questions about our APIs, once you've read the doc, but please understand that we won't be able to supply you with the code to integrate with your Swing app -- that's your job.
--mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Similar Messages

  • How to create Base Dimensions with MaxL and Text File?

    Hi,
    Doing a scratch rebuild of a cube every month. Don't want to have a 'dummy' outline with base dimensions to copy over every build. Instead want to build from text file somehow. Thus my plan is to: 1) Delete the existing app/db 2) Create a new blank app/db 3) Create the base dimensions in the outline via text file and 4) Build entire outline via a text file. I'm stuck on #3 how to get the 'base dimensions' built via text file. I need:
    ACCOUNTS
    PERIOD
    VALUE
    VIEWS
    SCENARIO
    CUSTOM4
    YEAR
    CUSTOM3
    CUSTOM2
    ENTITY
    CUSTOM1
    I see this MaxL, but it uses a 'rules file' and I never have built a rules file to create base dims so I'm confused if it's possible or not...
    import database sample.basic dimensions
    from data_file '/data/calcdat.txt'
    using rules_file '/data/rulesfile.rul'
    on error append to '/logs/dimbuild.log';

    We rebuild our Departments and Organization from an enterprise hierarchy master each week.
    The way we implemented (what you call #3) was to not do #1 and #2, but to have a "destructive" load rule for each of these dimensions using a text file. (in the "Dimension Build Settings" for the load rule, select "Remove Unspecified" to make it destructive)
    The text file just has the dimension name (parent) and any children we needed defined in a parent/child relationship. For instance
    "Sales Departments" "0100-All Departments"
    This essentially works the same as deleting the app because the destructive load rules will drop all the blocks of data that were unspecified.
    Then we run our SQL load rule to build the rest of the dimensions from the Location Master.
    We perform a level-0 export prior to this process, then reload the level-0 data and execute all the consolidation scripts to get the data back (now in a current enterprise defined hierarchy)

  • How to save a image with JSF and get your URL

    Hi
    I need to save a image to my file system and get your URL. I�m working with JSF.
    Ex.:
    1� Save a image Cup.jpg on the server
    2� Get your URL
    result: http://www.mysite.com/images/Cup.jpg
    Thanks!!!

    I don't understand what's the problem? Can you please elaborate? Show some code snippets and tell where you stucks on.

  • How to save Query in a workbook and Role

    Hello All
    What are this workbook and role?How to save the query into this and how it helps/use us.
    can anyone tell about this?
    regards
    balaji

    Hi,
    You need to assign a role to a user. WHen this user enters the system s/he will be able to save queries under the role (the button 'Roles' will be seen).
    See here an example of working with roles:
    Re: How to protect Queries from being modified ?
    Best regards,
    Eugene
    Message was edited by: Eugene Khusainov

  • How to save a png with a straight or fat alpha?

    Long story short, work in broadcast and a new piece of gear prefers png files.  I know how to save png's with a transparency, that's not the problem.  What I don't know how to do or if it's possible is to save them with a straight or fat alpha.  Right now we feather or extend the edges out past the alpha of say a logo and save it as a tif, psd or .tga.  That way once it's keyed over video or whatever, the edges look good, no black bad edging.... this makes sense, probably not explaining it very well.   But switching to png files I have no idea how to make a straight or fat alpha since it sees transparency.  I mean if I feathered out the edges, a png will see that correct, since there's no alpha??
    I hope this makes sense ?

    Chris, this is probably the answer I seek "PNG always saves with straight color - that's how the PNG spec defines it." 
    I admit my explanation was a bit weak and I understand PNG only supports transparency, which is not an alpha,  and the apps aren't treating them wrong....I just couldn't formulate an intelligent question and explain it, my bad.
    After thinking about it I don't think using a PNG will work. RIght now for broadcast gear/applications if we don't fill the transparent and semi-transparent areas of an image with the colored part of the image, we usually end up getting a dirty key/matte or a lot of fringing.  So when using a .tif or .tga that reads an actuall alpha, we can fix the issue by doing what I described.  In fact we use a quick little plugin from flaming Pear called "Solidifty" to speed up the process http://www.flamingpear.com/download.html .  With that said, I know we can't do the same steps with a png because it only sees transparency, but I guess I was wondering if there was a work-around or a trick to fix that issue.  I could be wong, but doesn't a png save with white ?
    But again, as I thought about it, I think i'm asking for something it's not meant to do, but I thought I'd ask anyway.
    Thanks Chris, does this make more sense or more confusing?  The bottom-line is I don't think it will work.

  • How to save a flash with .SWF

    Hi, I have the 'Adobe Flash CS3 Professional', and I want to
    know if you could tell me how to save a flash with .SWF.
    When I want to create a new project, I can chose between nine
    types of documents, and I want to make a flash for a website. What
    type of document would you chose if you were me ?
    I can't write the name of the diferent types of documents,
    because I have this programme in Spanish.
    Can you help me ?
    Thank you

    FLA is the native source format - make your movie and then
    publish to SWF -
    you can not create an SWF initially - SWF is the
    exported/published format
    of your FLA>
    "Marti_17" <[email protected]> wrote in
    message
    news:gioa0k$otm$[email protected]..
    > Hi, I have the 'Adobe Flash CS3 Professional', and I
    want to know if you
    > could
    > tell me how to save a flash with .SWF.
    > When I want to create a new project, I can chose between
    nine types of
    > documents, and I want to make a flash for a website.
    What type of document
    > would you chose if you were me ?
    >
    > I can't write the name of the diferent types of
    documents, because I have
    > this
    > programme in Spanish.
    >
    > Can you help me ?
    > Thank you
    >
    >

  • How to save a graph with some parameters on it?

    hi
    my application involves analysis of data and plot a graph of analysed data, how to save graph along with analysed data in a file otherthan labview?

    Well, it sounds like you are wanting a picture of the graph, yes? If so there are two ways of getting it. First there is a VI method (Get Panel Image) that lets you get an image of the entire screen, and then there is a control method (Get Image) that lets you get an image of just the front panel object that you are interested in.
    The help file entries for either method provides added detail on how to uses these methods to save a picture of your data.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • How can I find text-item description and content in database?

    I make "Actual news" region with text and simple image items.
    With "Custom Search" autoquery I make news portlet with 10 latest news.
    But I will make with PDK-Java discussion portlet, in which users can read and write about last published (last created text item display name and content) news.
    My questions:
    - How can I find text-item description and content in database?
    - How I can sort text-items to find latest created in my region?
    I have Portal R2
    Thanks in advance.
    Cheslav

    I am sorry. The following are the related tables.
    WWV_TEXT
    WWV_TEXT_BLOCKS
    WWV_TEXT_BLOCK_USAGES
    WWV_USER_TEXT_BLOCKS
    WWV_USER_TEXT_BLOCKS$
    WWV_USER_TEXT_BLOCK_USAGES
    WWV_USER_TEXT_BLOCK_USAGES$
    May be you want to browse WWV_TEXT which is the core table.

  • How can I start anew with Photos and clear the (minimal) stuff it has uploaded

    I've about had it up to here with this new Photos scheme. I reorganised my Aperture libraries on both my iMac and MBA in preparation for this, delayed turning Photos on for a couple of days until I thought everything was ready based upon the limited advice that was out there, and then got stuck in an endless loop of "uploading" and "preparing" every time I opened Photos. There are 19,975 images in my Aperture library on the iMac. I was stuck at Uploading at anywhere between that number and 19,000 with no progress after hours of waiting. I tried all the tricks mentioned here including re booting, restarting the app, repairing/rebuilding the database, killing the "cloudd" process, etc.today Today when I restarted Photos, it now said I had 23,775 images to upload- 4000
    more than I have-and of course it got stuck there, like it has for the last week.
    I copied the previous Aperture library (pre Photos migration)back to my iMac and opened it in Aperture. Thankfully, all the photos I had taken on my iPhone this week during this Photos clusterphuck transition were in the Aperture Stream so I didn't lose any of those. I'm willing to give this whole thing one more shot. So  i need some advice. How can I start anew with Photos and clear the (minimal) stuff it has uploaded (about 6000 of 19,000 images in the last 7 days) ? If I simply delete the Photos.photolibrary file will that do the trick and lt me start a new fresh library using?
    <Re-Titled By Host>

    How can I start anew with Photos and clear the (minimal) stuff it has uploaded (about 6000 of 19,000 images in the last 7 days) ? If I simply delete the Photos.photolibrary file will that do the trick and lt me start a new fresh library using?
    It is hard to say from your post, why the migration did not succeed in your case.
    by "stuck on upload" do you mean, you opened the Aperture library in Photos, and Photos converted it to a Photo Library, and then the upload to iCloud Photo Library did hang?  Or did already the upgrade to the Photo Library fail?
    If you want the Aperture library to upload to iCloud Photo Library, it needs to be on a disk formatted MacOS Extended (Journaled) and the original image files must not be referenced. Referenced originals will not upload.
    Also, the upload may hang, if you do not have enough free iCloud storage, orr if one of the videos or photos in your library is in an unsupported format or corrupted.
    To start over, try to repair and rebuild the Aperture library before opening it in Photos. Try all Aperture Library First Aid options - starting with repairing the permissions.  (Repairing and Rebuilding Your Aperture Library: Aperture 3 User Manual)
    If I simply delete the Photos.photolibrary file will that do the trick and lt me start a new fresh library using?
    You will have to delete the photos that are already in icloud too; otherwise you are risking duplicates.
    Can you launch Photos at all?  If yes, delete all photos in Photos and empty the Recently Deleted album. Wait for the deletion to sync to iCloud. Then delete the Photos.photolibrary.

  • My hard drive died last week, and I needed to install a new one.  Previously, I was able to save a .doc with text and inserted photo to .pdf and then to .jpg.  Now I can get the .pdf but can't determine what to do to convert to .jpg.  Does anyone know ?

    My hard drive died last week, and I needed to install a new one.  Previously, I was able to save a .doc with text and inserted photo to .pdf and then to .jpg.  Now I can get the .pdf but can't determine what to do to convert to .jpg.  Does anyone know ?

    Rather than do that, which means starting over from scratch, losing all your edits, organisation and so on, why not simply use iPhoto Library Manager to revert the Library to the older version? Easier, less destructive.
    The instructions on that are here
    If you really want to start over: you can access the Originals folder simply by going to your Pictures Folder and finding the iPhoto Library there. Right (or Control-) Click on the icon and select 'Show Package Contents'. A finder window will open with the Library exposed.

  • I have a problem with mail.  the spelling and grammer check box before sending the messege is no longer there.  I did everything but cannot get it back.  is ther anyone who knows how to get the box with spelling and grammer checks before sending

    i have a problem with mail.  the spelling and grammer check box before sending the messege is no longer there.  I did everything but cannot get it back.  is ther anyone who knows how to get the box with spelling and grammer checks before sending the mail.
    Also the mail is acting very funny by not getting the rules work in a proper method.  Is ther a software to repair mail.

    i did both of them, but still the while sending the mail the diolog box is not showing up and also the spelling and grammer does not do the spelling check. 
    This problem just started for about 3 to 4 days now.  earlier it was working normally.

  • I already have a new book that is ready to publish as an iBook. In addition I also have an app prepared for this book. Please tell me how to upload this book (title is: "How To Cope...with life") and the app for it into your iBook Authors app so I can hav

    I already have a new book that is ready to publish as an iBook. In addition I also have an app prepared for this book.
    Please tell me how to upload this book (title is: "How To Cope...with life") and the app for it into your iBook Authors app so I can have it offered for sale @$0.99, in your app store?
    FROM: Terry Weber, Email: [email protected]

    https://itunesconnect.apple.com/WebObjects/iTunesConnect.woa/wa/bookSignup

  • How to save a photo with a password on a mac

    how to save a photo with a password on a mac

    http://osxdaily.com/2012/08/12/encrypt-folders-mac-os-x/
    Note: I have never tried this.
    Best.

  • How to save mac compatible ai eps and pdf on windows

    how to save mac compatible ai eps and pdf on windows

    haykaz,
    You can, but there may be no need. There is, or at least may be, a certain deterioration in appearance when you outline fonts, especially in connexion will small point sizes.
    Rereading, I noticed the PDF part. Normally, the fonts are embedded in PDF and thereby platform independent.
    Have you tried and found any issues?

  • Anyone know how to gernerate CRUD applications with flex and coldfusion?

    Anyone know how to gernerate CRUD applications with flex and
    coldfusion? I am working with a remote coldsfusion installation
    with MS SQL and I don't have RDS.

    You might investigate "squidhead". It is CF based. I'm not
    sure if it has any Flex related features.
    http://squidhead.riaforge.org/

Maybe you are looking for

  • HT4061 how to check my i phone's warranty

    i want to check my iphone's warranty

  • Using DB2's import/export utilities in Java program

    DB2 database has build in utility called export, throgh which we can export the output of a Query directly onto a Lotus 123 file. But I beleive that , to invoke such DB2 utilities throgh a Java Program, we need to have APIs. My question is ,are such

  • Query for MRP Purchase Requisition

    Hi Gurus, Currently system is creating Purchase requisition for BOM Material, which I don't want system should create PR for this material. I know MRP type ND but i need someother ways to stop it Appricate your response Thanks Sastry

  • Text file problem

    I wanna search a text file, and get the database name from it. The database name usually follows "BATCH". How can I do that. Thanks.

  • Debugging help

    In the debug view I have this for a variable: this.parameters = Object (@15ad7e99) debug = "true" localIP = "10.4.1." However after I do this code in flash: var ip:String = ""; ip= this.parameters.localIP; var debug:String = this.parameters.debug; th