With the help of a enum with SecondaryKey using DPL

Hello

I read in past posts that enums couldn't be used with the keys, but I can't see that it turns out that they are supported according to:

PrimaryKey (Oracle - Berkeley DB Java Edition API)

They can also be used as a SecondayKey with a ManytoOne relationship?  I have an Employee class and an enum Service as shown below:

@Entity

public class employee {}

@PrimaryKey

private String empCode.

@SecondaryKey(relate = ONE_TO_ONE)

private String name;

@SecondaryKey(relate = MANY_TO_ONE)

private Service serviceType;

...

public enum {Service

CIVIL, MILITARY, CONTRACTOR

}

When I try to get the Employee entities through this index of SecondaryKey

SecondaryIndex < String, String, employee > personByService;

dao.personByService.get (Service.CONTRACTOR);

I get a compilation error:

error: incompatible types: Service cannot be converted to string

Do I have to declare the SecondaryIndex differently?

Any help is greatly appreciated

Thank you

Scott

Hi Scott,.

Yet, it should work with secondary keys. The declaration should not be? :

EmployeeService, String, SecondaryIndex > personByService

-mark

Tags: Database

Similar Questions

  • With the help of windows Explorer XP does use CPU to go to 100% and the blocking of the system forever

    With the help of windows Explorer XP does use CPU to go to 100% and the blocking of the system, forever, until closing by force.  What can I do?

    It is very difficult to manage my files.

    I suggest you download Process Explorer. This freeware utility performs a similar function to the Windows Task Manager, but it goes much further.

    For more information about Process Explorer, see here:

    http://www.Microsoft.com/technet/sysinternals/SystemInformation/ProcessExplorer.mspx

    Explorer.exe is used by a number of applications. The posting process and see which element below uses explorer.exe.

  • With the help of button text label in case selector

    Hello forum members

    I have to use a digital button with labels of text instead of numbers:

    For better readability of the code I would use the text (not the value of the entire control) values in a structure of matter as a selector directly values. I could use the "[] labels text" or the "Digital displays [] well, if I could cast a ring or enum.

    The help of LabVIEW offers:

    Text [] property Dim labels hasPlayer, hasPlayer playerversion = false playerversion = 10 Do While playerversion > 0 On Error Resume Next hasPlayer = (IsObject (CreateObject ("ShockwaveFlash.ShockwaveFlash." & playerversion))) if hasPlayer = true then Exit Do playerversion = playerversion - 1 loop is_FlashVersion = is_Flash playerversion = hasPlayer

    If you want to create no sequential numeric values, use the Digital Displays [] property to get a reference to the display of text label then convert the reference to the class of the ring and use the property of string values and [of] .

    But I don't understand how to do the casting or if I am misunderstanding of aid.

    Does anyone have a suggestion?

    Thank you!

    Klaus

    Klaus M says:

    I now believe that it is not possible to use such a dial marked as a control of enum in food of a selector ' for text.

    Depends on what you mean by "as an enum. The text label can be connected on a box structure. You must manually set the element box selectors, however, for different cases you have. You cannot dynamically create the enum, if that's what you're fishing for. You can, however, have defined as typedef enum and cast.

  • My AirPort Extreme end not implemented with the help of AirPort Utility

    Bought a used AirPort Extreme (Genesis 4) of a person who showed me that he worked at home. When I try to set up as a Wireless extender to my last existing AirPort Extreme, he will not carry out synchronization upward with AirPort Utility. It appears as a new extreme, but get a message 'unexpected error' before or after the name. Have you tried to reset the two while it is powered and turning the as explained in the help.

    When I try to set up as a Wireless extender...

    Gen 4 airport will connect to your existing AirPort Extreme wireless... or... it will connect using wired Ethernet wired, Permanent?

    .. .it will not accomplish the synchronization upward with AirPort Utility.

    Which version of AirPort Utility?  If it's on your Mac... and you don't know what version you have...

    Open AirPort Utility

    Click the AirPort Utility menu in the upper left corner of the screen

    Click on about AirPort Utility

    Report on the version number you see here

    You have an iPhone or a handy iPad that could be used to implement the 4th Gen airport if the problems continue with the help of your Mac?

  • With the help of iPhone 6 s. try to copy the text message with a tap double and get a bubble with icons. How can I copy the message to paste in another?

    Try to copy a text to paste in another. When I double tap, as I always have, all I get is a bubble with icons on it. With the help of OS 10.0.2.

    maryml wrote:

    Try to copy a text to paste in another. When I double tap, as I always have, all I get is a bubble with icons on it. With the help of OS 10.0.2.

    Press and hold on the text and wait for the copy/more pop up.

  • With the help of Club running on the Nike watch +.

    Hello

    This is something I have tried to work for a while and have not yet been able to find an answer. At the moment I use Nike + management club on my iPhone to follow the tracks that I find that gps is better than just using the application of the workout on my watch. However, something that really bothers me is that I start the race on my phone, but I can't then view my stats while running without having to press on and tap the watch and wait for the application to load, very irritating to race. I want to be able to lift my wrist and live stats are there to watch me, not listening and not get my phone out of my pocket. Surely this is something that can make the original watch?

    As a separate issue with the new app, Nike +, it does not recognize the songs I downloaded on my phone of Apple music in my playlists, then I have to play the separatelay of music through the application of music as opposed to go with Nike +? The ides on how to fix or is this a known problem with the latest Nike + app?

    Hello

    You may find it useful to consult the support resources of Nike and/or contact Nike for assistance with the help of their application:

    More information:

    https://iTunes.Apple.com/us/app/Nike+-run-Club/id387771637?Mt=8

  • With the help of old gear series noon on El Capitan

    I have a Vox Tonelab SE effects audio Board (around 2004), there the old serial midi on the back ports. I hung with the help of a USB MIDI interface cable. While the USB Midi interface to the show in Audio / Midi set upward and also in the profile system for USB port it does not detect the Vox Tonelab so no communication lunch.

    There is a POWERPC application called ToneLabSE SoundEditor which I downloaded and installed in the hope he would install a driver but I guess that this obviously doesn't work on INTEL in any case. Using Wine I can run the PC version, but still no communication via midi.

    Someone at - it ideas, would like to get this Panel communicating effects via MIDI.

    Thank you

    Solved! Using the WINE app I've run the version of the PC of ToneLab SE editor application. So pretty unintuitively by changing the serial midi to USB, SERIAL interface cables that went to the and out on the Tonelab SE. Now of the Se ToneLab editor I can write banks of programs to hardware Tonelab, but unable to empty the banks since the material Tonelab to software. My main desire was to use Expression pedals on the Tonelab as Midi Ableton controllers and some of the switches to the control of the Looper stomp. Now I can do it all. Hooray!

  • With the help of Yosemite, I like Photos app in general; have big Aperture library, although I use rarely opening Tools. Advantages, disadvantages and pitfalls related to the migration of Photos?

    With the help of Yosemite, I like Photos app in general; have big Aperture library, although I use rarely opening Tools. Advantages, disadvantages and pitfalls related to the migration of Photos?

    Opening was a pro the Pro amateur-oriented or serious app, usually shooting Raw, probably on a digital SLR.

    If that's you then pictures will miss a lot for you.

    If this isn't the case, then opening was probably overkill for your needs.

    If you like the pictures then this is the way to go.

  • Thunderbird will only connect if stop then reopened. (With the help of Mac 10.9.4)

    With the help of Mac 10.9.4
    If I open Thunderbird, I can connect to my e-mail address and download the messages. If I select "Get Mail" once again, Thunderbird crashes and fails to connect to my emails. If I then close Thunderbird and re-open it, I'm able to immediately connect to my mail.

    It seems to have sorted itself after a few days. (Fingers crossed). Until today it worked properly. Will keep an eye on things for the next week and the report does so again.

  • Anyone having problems with messages of script with the new version of GMail and Yahoo Mail? All the others seem fine and no problems with other browsers. With the help of FF25

    Gmail and Yahoo mail are very slow to load. I get a message from the script almost whenever instruct me to continue or to stop the script. Everything I have shut down or restart the browser goes blank and hangs. So, I have to restart Firefox. I followed suggestions on the help pages for the slow e-mail accounts or issues. (cleared cache etc, reset etc.) nothing solves the problem. I only noticed the problem since the first update of FF25. Scripts to stop even on these pages is not acceptable, because you are directed to the pages who insist you must restart scripts. It's a nightmare! Gmail both Yahoomail are very slow to respond to clicks more.

    Your list of details of the system shows that you have a user.js file in the profile folder to initialize some preferences at each start of Firefox.

    The user.js file appears only if you or another software created, therefore, normally, he wouldn't be here.
    You can check its contents with a text editor if you do not create this file yourself.

    The user.js file is read whenever you launch Firefox and initializes the preferences to the value specified in this file, so set of preferences via user.js can be changed temporarily for the current session.

    You can rename or delete the prefs.js file and numbered possible prefs-# .js and the file user.js to reset all default prefs.

    You can use this button to go to the Firefox profile folder:

    • Help > troubleshooting information > profile directory: see file (Linux: open the directory;) Mac: View in the Finder)

    Note that the folder "Application Data" in XP/Win2K and the "AppData" folder in Windows Vista and Windows 7 and later versions are hidden folders.

  • ABP is blocking content from Ticketmaster, I tried to turn it off but it doesn't. I use Ticketmaster on my iPod, so I know that the problem is with the help of PBA.

    Tried different options of disabling with no joy. Don't know what else to do

    Try to start Firefox in safe mode. If there is no problem, then while
    a course in Firefox > Modules and delete the PBA. Then restart
    FF. If there is still a problem, Ad-Block can be reinstalled.

    ======================================
    

    Try Firefox Safe mode to see if the problem goes away. Safe mode is a troubleshooting mode, which disables most of the modules.

    (If you use it, switch to the default theme).

    • Under Windows, you can open Firefox 4.0 + in Safe Mode holding the key SHIFT key when you open the desktop Firefox or shortcut in the start menu.
    • On Mac, you can open Firefox 4.0 + in Safe Mode holding the key option key when starting Firefox.
    • Under Linux, you can open Firefox 4.0 + with leaving Firefox then go to your Terminal and running Safe Mode: firefox-safe-mode (you may need to specify the installation path of Firefox for example/usr/lib/firefox)
    • Or open the Help menu and click on the restart with the disabled... modules menu item while Firefox is running.

    Once you get the pop-up, simply select "" boot mode safe. "

    If the issue is not present in Firefox Safe Mode, your problem is probably caused by an extension, and you need to understand that one. To do this, please follow article Troubleshooting extensions, themes and problems of hardware acceleration to resolve common Firefox problems .

    To exit safe mode of Firefox, simply close Firefox and wait a few seconds before you open Firefox for normal use again.

    When find you what is causing your problems, please let us know. It might help others who have the same problem.

    Thank you.

  • With the help of v22.0 cannot apply update - will not even after several reboots - advice?

    bold text

    Hello

    Some Firefox problems can be solved by performing a clean reinstall. This means that you remove Firefox program files, and then reinstall Firefox. Please follow these steps:

    Note: You can print these steps or consult them in another browser.

    1. Download the latest version of Firefox from http://www.mozilla.org office and save the installer to your computer.
    2. Once the download is complete, close all Firefox Windows (click on quit in the file menu or Firefox).
    3. Remove the Firefox installation folder, which is located in one of these locations, by default:
      • Windows:

        • C:\Program Files\Mozilla Firefox
        • C:\Program Files (x 86) \Mozilla Firefox
      • Mac: Delete Firefox in the Applications folder.
      • Linux: If you have installed Firefox with the distribution-based package manager, you must use the same way to uninstall: see Install Firefox on Linux. If you have downloaded and installed the binary package from the Firefox download page, simply remove the folder firefox in your home directory.
    4. Now, go ahead and reinstall Firefox:
      1. Double-click on the downloaded Setup file and go through the steps in the installation wizard.
      2. Once the wizard is completed, click to open Firefox directly after clicking the Finish button.

    Please report back to see if this helped you!

    Thank you.

  • I get double Firefox screens declined downloads articles. With the help of FF19

    FF19 opens fine. However when I go to open an article reduces the brightness of the screen and when he returns to retouch the brightness, there are now two screens, one behind the other. When this happens, I am unable to do anyhting in FF and must end the process.

    Try Firefox Safe mode to see if the problem goes away. Safe mode is a troubleshooting mode, which disables most of the modules.

    (If you use it, switch to the default theme).

    • You can open Firefox 4.0 + in Safe Mode holding the key SHIFT key when you open the desktop Firefox or shortcut in the start menu.
    • Or open the Help menu and click on the restart with the disabled... modules menu item while Firefox is running.

    Once you get the pop-up, simply select "" boot mode safe. "

    If the issue is not present in Firefox Safe Mode, your problem is probably caused by an extension, and you need to understand that one. To do this, please follow article Troubleshooting extensions, themes and problems of hardware acceleration to resolve common Firefox problems .

    To exit safe mode of Firefox, simply close Firefox and wait a few seconds before you open Firefox for normal use again.

    When find you what is causing your problems, please let us know. It might help others who have the same problem.

  • Install OSX 10.11.4 I do cleaning but R command will not work. With the help of USB keyboard so not wifi issues to to worry. Help?

    Install OSX 10.11.4 I do cleaning but R command will not work. With the help of USB keyboard so not wifi issues to to worry. Help?

    Would you like to share why you must do a clean install?

    You can try the recovery of the internet (which will work if your older model has been updated to enable of): hold command + Option + R until you see a progress bar (take a while). It will connect you to the Apple servers. When you see the utility window, choose disk utility to erase your disk and when you're done, choose to reinstall OS X.

    Computers that can be upgraded to use OS X Internet Recovery - Apple Support

    PS: Correction: I think not yours can be updated; in this case, you will need the original installation disks to wipe the drive and reinstall.

  • ow change titles &amp; dates of lots of pictures (like in iPhoto?) With the help of Mac 'Pages' on, 2008 aluminium MacBook running OSX El Capitan 10.11.4

    How to change titles & dates of lots of pictures (like in iPhoto?) With the help of Mac 'Pages' on, 2008 aluminium MacBook running OSX El Capitan 10.11.4

    With the help of Mac 'Pages '.

    A typing mistake?

    If it is and you mean Photos Date of Mac are modified by selecting the photos using the Image menu == > adjust the time and date of order and changes made to the metadata such as keywords, location, etc. are made by selecting the photos and find the info and registering metadata in the Info window

    These are detailed in the help topics of pictures - a good place to look for help on the Photos

    View and add information about the photos

    You can view and add information about your photos. For example, you can see the date and time a photo was taken, the information about the camera that took the photo and badges that indicate the status of the photo. You can assign titles and captions to photos, add or change the location of the photos and change the date and time for them information. You can select multiple photos in an instant and add or change information about them all at once.

    Open pictures for me

    View and add information about the photos

    To view or change information for the photos, you select one or more photos, and then open the information window.

    • Open the Info window: Double-click a photo to view it, and then click the Info button in the toolbar or press on command I.
    • Add or change information: Change the following.
      • Title: Enter a name in the title field.
      • Description: In the Description field, type a caption.
      • Favorite: Click the Favorites button to mark the photo as a favorite. Click the button again to deselect.
      • Keywords: Enter the keywords in the keywords field. When you type, Photos suggest keywords that you have used before. Press enter when you have finished a keyword. To remove a keyword, select it and press DELETE.
      • Faces: Click on and type a name to identify a face. Click on several times, and then drag the identifier of the face different faces to identify many faces in a photo.
      • Location: Enter a location in the location field. When you type, Photos suggest places you can choose. To change a location, you can search a different location or change the location by dragging a PIN on the map. To remove location information, delete it or choose Image > location, then choose Remove location or back to the original location. You cannot assign a location if your computer is not connected to the Internet.

    Show titles, other metadata and badges

    Change the date and time of photo

    You can change the date and time associated with a picture. You can do this if you are traveling to a location in another time zone, and your camera affect your dates photos and periods that are correct for your House, but not the place you visited.

    1. Select the photos you want to edit.
    2. Choose Image > adjust Date and time.
    3. Enter the date and time you want in the modified field.
    4. Click a time zone on the map, if necessary.
    5. Click on adjust.

Maybe you are looking for