DPL Question Pattern Design.  What is the nearest equivalent of an enum?

Hi all
I have an application that uses the Direct persistence layer. I have a field that will be a small number of statically defined fields that will never change without a major code release (currently 8 possible values). What is the best practice to define this field?

In the relational world, I would create a table of correspondence with 8 fields, insert the valid values via the installation script and then use the foreign key index to apply the relationship. I might even be tempted to set a constraint.
In the Java world, I would simply define an enum.

In the DPL, there is currently no support for the enum. I could create a table of choice and foreign key in BDB, but I really don't want to set a table to store the values of 8, if there is a reasonable alternative. Also, I don't be questioning this field, then the @SecondaryKey would like to add a performance and substantial storage penalty.

Is there an inexpensive way of the definition of constraints?







I need to create an audit trail object. The audit trail is incredibly simple. Each entry includes a:





< ul > < li > topic: UUID linking to my users table
< /li >
< li > verb: must be an enum
< /li >
< li > subject: UUID, a link to My Documents table. < /li >
< li > timestamp: java.util.Date
< /li >
< /ul >
An example would be "d41e0d41-138f-4f99-9563-16a32c2238ea READ 5e5ec60f-507e-4085-913b-a68281c13835 Mon Nov 17 16:58:13 UTC 2008" including our GUI would result in "Dr. John Doe read your Lipitor prescription today at 16:58.

Our class structure is:

@Entity
public class AuditEvent {}
@PrimaryKey
private String pk;
private String subjectId; UUID - never questioned
action of private; channel enum - never questioned
@SecondaryKey (refer = Relationship.MANY_TO_ONE, relatedEntity = Document.class)
private String object UUID
private Date timestamp;
some getter and setters here.
}


Thanks in advance,
Steven

Published by: JavaGeek_Boston on November 17, 2008 17:08

Hi Steven,

Enums are supported in the DPL for key fields. You have nothing special to do - the Enum class must not be annotated.

Enums are currently not supported as key, because we did not understand how the evolution of sorting and the class should work.

The doc which is authoritative for what can be persistent is in the javadoc of the entity and the javadoc PrimaryKey lists types may be used for the keys.

-mark

Tags: Database

Similar Questions

  • Two questions: 1. What are the procedures to superimpose an image on top of the other? 2. how resize you, make adjustments, adjust transparency overlay image etc? I use a MAC with Photoshop Lightroom.

    Two questions: 1. What are the procedures to superimpose an image on top of the other? 2. how resize you, make adjustments, adjust transparency overlay image etc? I use a MAC with Photoshop Lightroom.

    HI Timp,

    Sorry, but that kind of image manipulation is not for the purpose of Lightroom and more oriented toward Photoshop and retouching of composition of similar images.

    Please check the links to know the image overlay in Photoshop below:

    Mix photos with apply Image in Photoshop

    http://www.photoshopessentials.com/photo-effects/blend-photos/

    The superimposition of Images in Adobe Photoshop | DIY digital composition

    For more good result to check the google search.

    Google search: Google

    Concerning

    Sarika

  • INTERFACE design - what is the best way to allow the user to define a kind of infusion at various times (non-periodic)?

    I want to allow the user to specify a curve like this:

    Such as some under - VI shows the A2 value when a variable of time is between R1, A1 when the time variable is between A2 and A3 when time is in the range A3.

    My design looks like this:

    With the error checking that looks like this:

    My question is, is the approach of the table according to optimal? Otherwise, how could combat this?

    I think I can summarize the conversation on this point as a response to the original question (what is the best way...) -to start writing code, to think about what you want to accomplish and write it down (otherwise known as 'Write the first Documentation').  One of the points of a good User Interface is that it is not allow users to "stupid mistakes" - it leads the user "by hand", limiting the entries to the "legal values" and demanding that the entries be made logically.

    If you were going to have a list of Infusions to enter, it is therefore logical to decide or not to enter into time intervals (which are always > 0) or order the times (which, logically) are still growing.  You can (and should) decide that you (or you may have a control that allows the user decide, but maybe it's too flexible) and then apply your "rules".

    Let's say you've decided on "Intervals" (which seems to me to be more User Friendly).  After the user has entered the intervals (and you've provided a nice plot of perfusion vs. time), pouvez allow you the user to an interval of 'split', 'Delete' an interval, or "Edit the Infusion" interval, or you can decide to have a choice more simple "accept or start again" - If you have only a few intervals, the last would be the simplest (and therefore best) design choice.

    Spend more time thinking before coding usually pays Big dividends!

    (Speaking of sad experience) Bob Schor

  • What is the integer equivalent of the t - sql in oracle?

    I heard that oracle is not an ' Integer ' for table structures.

    He took all my fields of integer type and makes them Number (10.0).

    When my program runs, it compares the result in full and fails... If I look at the value it says "1 d" which I assume means 1 decimal Typedonnees.
    I need to return an integer data type. I need to change the Number (10,0) number (10) or something else?

    number (10,0) is an integer type. How do you compare numbers? I suspect a problem of conversion of customer.

    Moreover, this forum is specifically for the SQL Developer tool. You can get more answers in the forum 'SQL and PL/SQL '.

  • What is the resolution for USB-6210 for positive ranges of entry?

    Hello

    I use USB-6210 to sample different types of sensors and each has its own range of values. I have two questions:

    (a) what are the fixed beaches of USB-6210 where most suitable is chosen automatically depending on the settings of user intput scope? They are to +/-0.2, +/-1, +/-5 and + /-10?

    (b) I know that if I select + / 10 as the range and then I will get the resoultion of 20 /(2^16), but what happens if I want to the positive range only? So if my sensor gives values between [0.10] and data acquisition would choose the + / 10 range. Then could get a resolution higher than 20 /(2^16) and how?

    Thank you.

    (a) Yes, they are the ranges listed in the manual

    (b) No, a fixed range means a fixed range. You cannot change them.

  • What is the difference between the "Software Version" and "Version of the platform?

    I posted in this forum, because there is a maximum activity in this forum. Sorry, if this is not a good place to post this kind of question.

    What is the difference between the "Software Version" and "Version of the platform" of any blackberry device?

    My camera's curve 8900 and I can see in the menu About his version of software is 4.6.1.231 and the version of the platform is 4.2.0.108. What are these 2 versions for?

    Probably the best posted in the software section of the device, but is not serious.

    Version of the software/App - indicates the version of your applications (address book, browser, calendar, etc.).
    Version of the platform - indicates your version of system software (Java based software, radio code, etc.).

  • What is the SPORTS service

    I get a message on my observer of events as follows:

    "The SPORTS service failed to start due to the following error:

    The system cannot find the specified file. "I followed the link to the event log online help, andfollowed instructions. The error code 7000 links with % 2, which seems to be a file not found problem. However, as it does not say which file is not found, then is not very useful.

    Question: Anyone knows what is the SPORTS service, because I can't find any reference on the web, and none in technet or on this forum.
    Additionally - it is important that these errors are happening, or should I just ignore them?

    hwalker1

    Howard

    I have no answer, but found this. It seems that it is thanks to your Samsung printer. Therefore, it seems that you are on the right track.

    'Delete HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesSSPORT after installing a printer driver Samsung on something else than Windows XP. It is certainly the Samsung driver installation program that adds this registry key. All my Samsung printers work fine even if the service cannot always start, and delete the registry key gets rid the failures of notification of start boring service. »

    Hope that helps you a bit.

  • Campus 9.0 solution: what is the endpoint URL AAWS?

    People,

    Hello. I have implemented PeopleSoft Campus Solution 9.0 revision 5 for a University.

    I need to develop an application for Admission online for future student to apply for admission.

    My installations of PeopleSoft are below:

    Server machine: Oracle Linux 5.10 (64-bit)

    Client computer: Windows XP Professional (64 edition) with the Internet Explorer browser

    Architecture Internet Oracle Linux 5.10 Server:

    (1) database server: Oracle Database 11 g version 11.1.0.6.0 is

    (2) the server application: Tuxedo 11 g

    (3) web Server: Web Logic 10.3.6.0 and JDK 1.7.0_09

    (4) browser: Firefox Mozila

    (5) two Instances of huge database on the database server: 8.53 PeopleTools and Campus Solution 9.0.

    To develop the application for Admission online, I made the 4 parties with WebLogic 10.3.6 and JDK 1.7.0_09 as below:

    (1) install ADR (Application Development Runtime) 11.1.1.6.0 (64-bit)

    (2) install the RCU 11.1.1.6.0 to create the scheme of OWSM_MDS (32 bit)

    (3) create a WebLogic 'Domain_CS' domain in WebLgoic 10.3.6.0 in support of MARC 11.1.1.6.0.

    (4) install JDeveloper 11 g 11.1.1.6.0 Studio Edition including WebLogic 10.3.5.0.

    The application for Admission online is developed in JDeveloper 11 g 11.1.1.6.0 Studio Edition.

    The application for Admission online connected to AAWS (Admission Application Web Service) and through AAWS gets to database tables.

    AAWS has no Navigation in the browser. After you create the Web Application from merger, you must type in the endpoint URL for the Operations of Service. But I don't know what is the URL endpoint.

    My question is:

    What is the endpoint URL to PeopleSoft AAWS opération of obtaining for the request of Fusion ADF in JDeveloper?

    Thanks adavance.

    Also, try to check if all your service operations that you are trying to access to contains a range of "everything Local". If this is not the case, use the general tab and generate:

    I hope this helps. Thank you!

  • What is the differece between a Standard report column and that is set to display text (escape special characters)?

    Hello friends,

    My requirement is

    I want to create a table. Presents some columns to display text.

    so my question is,

    What is the difference between a Standard report column and display text (escape special characters) in the attribute column property?

    Kind regards

    Arianne.

    Hi ujwala1234,

    ujwala1234 wrote:

    Hello friends,

    My requirement is

    I want to create a table. Presents some columns to display text.

    so my question is,

    What is the difference between a Standard report column and display text (escape special characters) in the attribute column property?

    Kind regards

    Arianne.

    Here is the difference:

    • Standard report column: this is used when your column in the SQL query returns the HTML markup. For example the query SQL with APEX_ITEM API columns or columns where you have mixed data in the column with the markup. In short, APEX rendering engine treats the column as HTML markup and analysis accordingly to display the required HTML element.
    • Display text (escape special characters): this type analysis the column data in the form of data stored in the database (no HTML). During analysis if the data contains special characters then it escapes and displays the data.

    Yes, you can mix the manual in the form of built on APEX_ITEM with normal standard report (display text) columns.

    I hope this helps!

    Kind regards

    Kiran

  • What are the best settings for host when PPTX is looping continues

    With the help of Jorma is was able to realize my PPTX in continuous loop, and change the number of seconds a slide was shown see How to let a pptx presentation run on its own

    There is only one question left. What are the best settings. I find that to let him run, I need to press the sync button, but then participants may choose (inadvertently) to stop the presentation of the execution of the loop.

    What are the correct settings, so that a participant sees only the slides (no side bar etc) and the loop is running?

    Your response is much appreciated

    You should not need to press the Sync button. In the options menu Pod for the sharing, with the loaded PPT module, you'll see an option to view the presentation bar. Use that to get the part for the hosts and presenters in the room, then press the button play. The presentation will be now play in a mode loop for everyone in sync mode. You can also hide the PlayBar to keep other hosts and presenters to stop playback and Participants will never see the PlayBar or have the option to stop the presentation.

    In addition, if your door essentially on the sharing module (highlight a focus), you can use the 'P' button to start playing the presentation without revealing the PlayBar to just anyone. Adobe Connect 9 * accessibility features

  • What is the parent resource ID in the Gantt resource chart?

    Hello everyone,

    Sorry if this question seems silly. I'm trying to create a Gantt chart of resource from a database table. I mentioned this page ' http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21674/bldapp_chrt.htm#BCEIJJID "for more information, but I see the following there:

    «The Gantt resource charts require a resource resource name, id of parent resource id, actual start date and the value of actual end date for each task.» To create a Gantt chart of the resource, create a Flash chart and provide a SQL query using the following syntax:

    SELECT the link, id_ressource, resource_name, resource_parent_id, actual_start_date, actual_end_date
    Of...
    "

    What is the parent resource ID? I can't find it. Is it also necessary? Can I create a Gantt chart without it?

    Thank you
    Mohamed

    Hi Mohamed,

    To answer your questions:

    Q: what is the parent resource ID?
    REP. : In your data, you can have certain tasks that are associated with another task i.e. parent child tasks to a task. This association must be held to a column in your database table, for example PARENT_ID. The value contained in the PARENT_ID column would be the ID of the parent task that is associated with the current task. For example, on this page - http://apex.oracle.com/pls/apex/f?p=36648:86 - you can see that the 2nd task, "Request for Update Wizard", is a child of the node parent 'Integration of graphics' and that association is based on the value stored in the column PARENT_ID of my sample table.

    Q: is it required? Can I create a Gantt chart without it?
    REP. : No, it is not required. However, the syntax of the query must include PARENT_ID, which you can of course set to NULL, as you can see in the following example:

    SELECT NULL LINK,
           RESOURCE_ID ID,
           TASK_NAME NAME,
           NULL PARENT_ID,
           START_DATE ACTUAL_START,
           END_DATE ACTUAL_END
    FROM   TASKS 
    

    Here is another example of query, where you can see that the PARENT_ID is set. In this case, we want to represent a hierarchical list of tasks

    SELECT 'f?p=4000:2:'||:APP_SESSION||':::P2_ID:'||ID LINK
           RESOURCE_ID ID,
           RESOURCE_NAME NAME,
           PARENT_ID PARENT_ID,
           START_DATE ACTUAL_START,
           END_DATE ACTUAL_END
    FROM   TASKS
    

    I hope this helps clarify things.

    Kind regards
    Hilary

  • What is the best way to import and export images from the 5 d Mark II?

    Hello

    I have just finished what I plan my first masterpiece of shooting film.  Shot on the Canon 5 d (1080 p, 24 fps), and the film looks amazing.  Now, I'm ready to start editing and now use creating lately, but I still have to figure out the proper conduct.  I want to know the best way to keep the resolution before I dive into this project.

    My questions:

    (1) what is the best way to start a new project and import the images without having to make while editing, in order to keep all the resolution and the originality of the source footage?

    (2) what is the best way / codec / format to export these images even once done editing to maintain than crisp 1080 p for which the 5 d is therefore counted?

    (3) what is the best way / codec / format for import and export / rendering between the first and after effects?  I speak especially of Visual effects and color correction.  I also a few sequences of 30 images per second that I intend to slow down in AE and then import into first.

    I know that it's wide enough, but as a solo Director I really need advice from someone.  Rarely, I finished my films with the same look crispy as images.  I need help of pipeline and really appreciate it!

    > used first lately

    A list of tutorial in the #3 http://forums.adobe.com/message/2276578 message

    1 - Please NOTE that the PPro CS6 screen may be a little different (I use CS5)

    For CS5 and later versions, the easy way to ensure that your video and your project

    See 2nd post for the photo of a NEW ELEMENT of process http://forums.adobe.com/thread/872666

    - and a FAQ on setting http://forums.adobe.com/message/3804341 sequence

    2 - BluRay... but I'm not sure if 1080 p is supported (I don't use of BluRay)

    1080 p http://forums.adobe.com/thread/995191 some work, some are not

    In addition, for upcoming posts, information FAQ http://forums.adobe.com/message/4200840

    In addition, read the metadata contained in the file http://forums.adobe.com/thread/1015001?tstart=0

    And finally, read Bill Hunt on http://forums.adobe.com/thread/919388?tstart=0 installation project

  • What is the best way to deal with a 'Implicit coercion' in a table to a sprite?

    Hi all!

    With the continued support of this forum, I'm getting closer to have a programme of work. I can't wait to be able to help others like me once I've finished learning the ropes of AS3.

    I'll briefly explain what I want to achieve and then followed with my question.

    Background

    I created a random number of 12 x 9 grid that fills each cell with an image, based on the numeric value of each cell. I also have a random play button that makes random numbers in the grid. The problem I am running became my click event of button to erase the current images off the grid in order to allocate the new (for example by removing the objects display battery in order to place the new ones in the same places).

    Question

    My question is this: what is the best way to manage an implicit constraint from a table to a sprite? I pasted my complete code below so that you can see how the functions are supposed to work together. My sentence is apparently not being able to use a value from array with a sprite (sprite represents the real layout of the grid on the pile of display while the table starts as a number that is assigned an image that must be transmitted to the sprite).

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

    package
    {
    import flash.display.MovieClip;
    import flash.display.DisplayObject;
    import flash.events.MouseEvent;
    import flash.display.Sprite;
    import flash.text.TextField;
    import flash.text.TextFormat;
    import flash.utils.getDefinitionByName;

    SerializableAttribute public class extends MovieClip Blanko
    {
    Contains 12 * 9 grid of cells.
    var grid: Sprite;
    Maintains the shuffle button.
    var shuffleButton:Sprite;
    Is equal to 12 columns, 9 lines.
    var cols: int = 12;
    lines of the var: int = 9;
    Equal number of grid cells (108).
    cells var: int = COL * rows;
    Sets of cell width and height to 40 pixels.
    var cellW:int = 40;
    var cellH:int = 40;
    Contains 108 images of cell.
    var imageArray:Array = [];
    Contains 108 numerical values for the cells in the grid.
    var cellNumbers:Array = [];

    Constructor calls the functions "generateGrid" and "makeShuffleButton".
    public void Blanko()
    {
    generateGrid();
    makeShuffleButton();
    }

    Creates and displays the grid 12 * 9.
    private function generateGrid (): void
    {
    grid = new Sprite;
    var i: int = 0;


    for (i = 0; i < cells; i ++)
    {
    cellNumbers.push (i % 9 + 1);
    }
    trace ("before shuffle:", cellNumbers);
    shuffleCells (cellNumbers);
    trace ("after shuffle:", cellNumbers);
    var _cell:Sprite;

    for (i = 0; i < cells; i ++)
    {

    / / This line is where the implicit constraint occurs. '_cell' is a leprechaun trying

    on a temporary basis equal to a value from array.
    _cell = drawCells (cellNumbers [i]);
    _cell.x = (I % cols) * cellW;
    _cell.y = (I / COL) * cellH;

    grid.addChild (_cell);
    }
    }

    Creates a "shuffle" button and adds a mouse click event.
    private function makeShuffleButton (): void
    {
    var _label:TextField = new TextField();
    _label. AutoSize = 'center ';
    TextField (_label) .multiline = TextField (_label) .wordWrap = false;
    TextField (_label) .defaultTextFormat is new TextFormat ("Arial", 11, 0xFFFFFF, "bold");.
    _label. Text = "SHUFFLE";
    _label.x = 4;
    _label.y = 2;
    shuffleButton = new Sprite();
    shuffleButton.graphics.beginFill (0 x 484848);
    shuffleButton.graphics.drawRoundRect (0, 0, _label.width + _label.x * 2, _label.height +)
    _label.y * 2, 10);
    shuffleButton.addChild (_label);
    shuffleButton.buttonMode = shuffleButton.useHandCursor = true;
    shuffleButton.mouseChildren = false;
    shuffleButton.x = grid.x + 30 + grid.width - shuffleButton.width;
    shuffleButton.y = grid.y + grid.height + 10;
    this.addChild (shuffleButton);
    shuffleButton.addEventListener (MouseEvent.CLICK, onShuffleButtonClick);
    }

    Erase the images of the cell, mix of their numbers and then assigned these new images.
    private function onShuffleButtonClick (): void
    {
    eraseCells();
    shuffleCells (cellNumbers);
    trace ("after shuffle:", cellNumbers);


    for (var i: int = 0; i < cells; i ++)
    {
    drawCells (cellNumbers [i]);
    }
    }

    Deletes any existing cells in the battery of the display image.
    private void eraseCells(): void
    {
    While (imageArray.numChildren > 0)
    {
    imageArray.removeChildAt (0);
    }
    }

    Changes cell phones numbers (makes random table).
    private void shuffleCells(_array:Array):void
    {
    var _number:int = 0;
    var _a:int = 0;
    var _b:int = 0;
    var _rand:int = 0;

    for (var i: int = _array.length - 1; i > 0; i-)
    {
    _rand = Math.Random () * (i - 1);
    _A = _array [i];
    _B = _array [_rand];
    _ARRAY [i] = _b;
    [_Rand] _ARRAY = _a;
    }
    }

    Retrieves and sets a custom image to a cell based on its numerical value.
    private void drawCells(_numeral:int):Array
    {
    var _classRef: Class = Class (getDefinitionByName ("skin" + _numeral));
    _classRef.x = 30;
    imageArray.push (_classRef);
    imageArray.addChild (_classRef);
    return of demonstration;
    }
    }
    }

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

    Any help with this is greatly appreciated. Thank you!

    If you want to have an array of Sprites that you later clear that is fine. But this does not mean that your function should return to it.

    You need your function to return the sprite so that you can add it to the display list and everything what you need.

    So just have the function get Sprite, push it in the "toBeClearedInTheFutureArray" and then return a reference to the currently acquired sprite.

  • What is the equivalent of Adobe Air to CoreData iOS?

    I used CoreData on iOS and love it.  Can someone tell me what is the mobile equivalent of CoreData's Adobe Air?

    I use EncryptedLocalStore to store the user's preferences, but it uses iOS keychain and causes data to persist on the device iOS via an app removal & install.  This is no good, since I'm store preferences that is a little more appropriate for the use of the keyring.  AND I want the app data deleted off the unit once the application is deleted/uninstalled.

    Any ideas?

    My opinion:

    Shared local objects if you want to have your prefs in the form of key/value pairs. or by using E4X with readObject and writeObject file API if you want to have your prefs in XML format.

  • What is the 'current' in the ODI Designer?

    Hello

    We have a certain contexts located in ODI and trying to configure logging (consisten whole - stream), we still have empty "list of subscribers in the current context", even there are Subscribers defined.

    The question is: what is the ODI context consider 'current' as long there is no option in the user interface / Designer level to set the current context? I imagined that this should be the context by default, but it's not.

    ODI version is 11.1.1.6.5.

    Thank you very much

    Andrei

    I finally found!

    In the designer, you can click 'Connect Navigator' (the little icon on the same line with icon refresh) and there you have the magic option called: "default designer context. '

    Andrei

Maybe you are looking for