Validation of attribute in Entity Object with List Rule Type

hi all
I have an entity "currncy" and I want to make
a validation in entity level on its attribute "Isdefaultcurrency"
which is boolean.
Entity Object : Currency
attributes :
1. Currencyid DBsequence
2. Currencyname String
3. Isdefaultcurrency, Boolean, CheckBox
Rule Type : List
Operator : In
List Type : Query Result 'select ISDEFAULTCURRENCY from currency where ISDEFAULTCURRENCY=1'
I want when user insert in table, validation checks the attribute 'Isdefaultcurrency'
was true then show the error message that there was default currency and if you
want to set it to true (or default) you must change another record that was true
and uncheck it then back to current record and will make it true and
there is one record in my table that its attribute 'Isdefaultcurrency' must be true
this validation that I used , it does not work correctly and it allows to enter 2 records with
true value for Isdefaultcurrency. In fact I want when User Enter the First record and
set the Isdefaultcurrency to true then enter the second record and set the Isdefaultcurrency
to true the error message will be shown.
pleas explain it
Edited by: Marzieh on Jan 30, 2012 9:43 PM

Is it that you want to only allow one record in the table to have isdefaultcurrency='1'?
yes , that is correct . I used Oracle DataBase .
DECODE(isdefaultcurrency, 1, 1, null) please explain about it.
isdefaultcurrency attribute has boolean Type with 0 or 1 values.
I would like to show an error if check box was checked for the second time. The idea is that just
one check box should be checked.
thanks for your answer

Similar Messages

  • How to put validation between attributes at View Object level in BC4J

    Hi,
    Is it possible in BC4J to put validation between attributes at View Object level?
    I know that I can do it at Entity Object level in validateEntity method, but I have several View Objects connected with one Entity Object and don't want to have the same validation logic for all View Objects.
    Thanks for any help!

    It returns errorWhat error does it return?
    John

  • Best way to validate multiple entity objects with each other

    I have the following scenario.
    There is one entity object with the following fields.
    Name
    Start Date
    End Date
    My requirement is to validate the dates in the entity do not overlap.
    What is the best way to achieve the same.
    This validation should be fired when we commit, since the user should be allowed to change the dates freely between entities.(Validation should not kick off when the current row changes)
    Thanks

    For this to achieve there is a concept called Effective Dated Entity Objects in Oracle ADF.
    Official ADF Documentation: http://docs.oracle.com/cd/E37975_01/web.111240/e16182/bcentities.htm#ADFFD20110
    Some blogs to help you
    http://one-size-doesnt-fit-all.blogspot.co.uk/2008/11/jdev11g-new-feature-effective-dated.html
    http://adfblogs.blogspot.co.uk/2011/09/understanding-effective-dated-entities.html
    Regards,
    Peddi.

  • Transient Attributes in Entity object vs View Object

    Hi Everyone,
    I need some suggestion with my project. I have a vendors table based on which I created an entity object (columns: vendor_id, contract_id, so on ) but I want to display vendor_name in UI which can be read from other table. I thought of using a transient attribute to populate this vendor_name.
    It is working fine when I create a new record (where I handled this in LOV return value of vendor_id field and it return vendor_id, vendor_name values) but when there is edit/view of page, this vendor_name is null which means I need to populate it during page load /refresh time. Can someone suggest me a better way to populate this transient attributes. I also want to know when should I use transient attributes in Entity object (I saw most of the developer using VO transient attributes in these kind of situation)
    Thanks,
    Ravi

    Hi,
    also want to know when should I use transient attributes in Entity object (I saw most of the developer using VO transient attributes in these kind of situation)
    transient values in entities are saved in the entity cache and thus can be changed in the UI. If you use transient attributes on the VO then these are read-only. All transient attribute however need to be populated upon page load, which you can do in a ViewRowImpl class that checks for a null value when the getter is called to then call a setter, or by using Groovy script as a default value (just set the attribute to script)
    Frank

  • ADF BC : "Attributes selected in query with no column type found! ..."

    hi
    Using JDeveloper 10.1.3.3.0, I have this "Selected in Query" attribute, "Never" updatable, in my Entity Object.
    The Entity Object is based on the SCOTT.EMP table and the attribute, called "BonusInfo", is defined using the expression " '[bonus info ' || (SAL * 2) || ']' ".
    see http://verveja.footsteps.be/~verveja/files/oracle/NoColumnTypeFoundApp-v0.01.zip
    While creating this Entity Object, I got a "Business Components" dialog that says:
    "Column type is not specified for this attribute. Specifying column-type and precision results in better query performance at runtime. Do you wish to set column type to VARCHAR2(255)?"
    I clicked "Yes".
    I also created two View Objects based on this Entity Object.
    In the "Create View Object" wizard "Step 4 of 7: Attribute Settings" I got a "Business Components" diaglog that says:
    "Attributes selected in query with no column type found! Specifying column-type and precision results in better query performance at runtime. Do you wish to set default column type for these attributes?"
    I clicked "Yes".
    Testing the query in "Step 5 of 7: SQL Statement" showed "Query is valid.".
    question:
    Why do I keep getting the message ...
    "Attributes selected in query with no column type found! Specifying column-type and precision results in better query performance at runtime. Do you wish to set default column type for these attributes?"
    ... in the View Object Editor if I click on different attributes?
    (I don't get such a message the first time I click on an attribute after opening the View Object Editor, but after that it keeps popping up each time I click on a different attribute, no matter what I answer "Yes", "No" or "Cancel".)
    many thanks
    Jan Vervecken

    Jan,
    BC needs the column type and precision so that we can allocate the correct JDBC buffer size; otherwise we would just allocate 2k per string.
    Blaise

  • Attributes selected in query with no column type found! (solved)

    Dear JHeadstart Team,
    In the view object Editor I have two entity based attributes attrib1 and attrib2
    both with type Number. Both have aliases with type number(9,0)
    If attrib1 is null I want to have the value of attrib2.
    In the expression box I put: nvl(attrib1,attrib2)
    When I press the ok button I get the next error message.
    "Attributes selected in query with no column type found!
    Specifying column-type and precision results in better query performance at runtime.
    Do you wish to set default column type for these attributes? "
    When I say ok I get the next message:
    "An error occurred. Unable to apply all the wizard changes.
    Column type cannot be changed for Entity based attribute.
    Exception: oracle.jbo.dt.objects.JboExeption."
    The details button serves no extra information.
    Since both the attributes have the same type I thought the nvl commando should work.
    But what does the "no column type found" sentence mean?
    regards,
    Marcel.
    Message was edited by:
    user571204

    Thanks Jan,
    You've put me on the right track.
    I found out that this is only possible in the entity object class.
    So I have to check my limited java skills.

  • Hello. I need to define a mesure in a picture: I took a picture of an object with a ruler and I want to signify to photoshop "this segment = 1 cm". How to do? Thank you!

    Hello. I need to define a mesure in a picture: I took a picture of an object with a ruler and I want to signify to photoshop "this segment = 1 cm". How to do? Thank you!

    That's a good precaution, norm.  It should be no problem is you have an object on a flat surface next to a ruler. It gets trickier in security camera frames.
    Anyway that is one example. Anne can look further into the measuring tools of  Photoshop Extended to see if it helps.
    A note on the screen resolution thing. When I calculate the screen resolution, I go into Photoshop > Preferences > Units and Rulers
    and enter it here in place of the default 72 ppi.  Then when I use View > Print Size, the on-screen rulers will match a physical ruler.
    That's if you wanted to look at the actual printed document size onscreen.
    Gene

  • Can I use subtype/supertype Entity Object with JHeadstart ?

    Hi,
    I am using Generalization on our entity object design, i,e : Employee(SuperType), Hourly_Employee(SubType), SalariedEmployee(SubType), Consoltant(SubType). The attributes attached below.
    All SubTypes will EXTEND the supertype : Employee.
    The questions are :
    Can JHeadstart handle the generalized entity objects ?
    How can the UI look like with JHeadstart ?
    Thank you for your help,
    Krist
    Supertype : Employee
    Employee_Number
    Employee_Name
    Address
    Employee_Type
    Date_Hired
    SubType : Hourly_Employee
    Hourly_Rate
    SubType : Salaried_Employee
    Annual_Salary
    Stock_Options
    SubType : CONSULTANT
    Contract_Number
    Billing_Rate

    Krist,
    If I understand you correctly you want to have a number of View Object attributes in a page to be accessible through 'subtabs', and want the correct subtab to be shown when the 'discriminator' field is changed. I am sorry for the confusion, I got thrown off track with all the super-subtype Entity details, but in the UI you are only dealing with ViewObject (usages), and not Entity Objects.
    Anyway, we can not generate 'subtabs'. There is a feature on our 'Enhancement list' to make the Regions have a 'stacked' property, which I think would come pretty close to what you need: you could group ViewObject Atributes together in Regions, and 'stacked' Regions would be generated as tab pages. We have not implemented this feature yet, and even if we had, you would have to change it post-gen because in your case, you would not want the end user to be able to 'switch tabs', but only a change of the 'discrimitator' field should do that.
    We have shipped some templates, though, for creating subtabs for child groups. Perhaps you could take a look if some of that code could be useable for your.
    I would suggest the following approach:
    1.) In the application structure file, create 'Regions' for all subtypes, and in the BC4J Property Editor, assign the 'subtype' attributes to the corresponding Region.
    2.) Regenerate the page. Now you should have a separate 'header' element for each subtype, containing the appropriate attributes.
    3.) Now you will need to transform those 'headers' to 'subtype tabs'. You could do that by borrowing code from our 'tabbed child' templates, or, alternatively, you could use a similar, Javascript-based technique that we use for switching between Quick Search and Advanced Search.
    4.) Finally, you should device a mechanism to change the active tab when changing the 'discriminator' column in the area above the tabs, with the supertype fields.
    Hope this helps,
    Peter Ebell
    JHeadstart Team

  • Jdev aborts when removing attribute from entity object

    Hi,
    after synchronizing my data model with my database scheme, jdeveloper 10g gave me the correct message, that there had been 1 attribute left in an entity object, that does no longer exist in the database.
    When removing the attribute from the entity object, jdev 10g aborts (first click: nothing happens, second click: abort).
    regards
    Klaus

    Thanks for bug report. This bug has been logged (3151203) and has been fixed in more recent builds.
    Ray

  • Sharing same entity object with multiple viewobject problem.

    Dear All,
    I have a common entity entity object, that i am using in 4 different vo(only the where clause is different),
    I have created 4 af:table from corrosponding vos, when i am inserting some records in any of the vo then all the vo is showing the same records.. even through each vo is having separate where clause,
    But when i do this with separate eo for each vo then it works fine..
    Here i just want to do with the single eo being shared by different vo of same kind.. except where clause, Also i want to know why this issue is comming on insert? is it normal expected behaviour ? If yes then how to overcome this problem..? Pls provide any good suggestions if you have..
    Thanks & Regards.
    Santosh.

    Hi Sacha,
    Thanks.. i read it and found following
    You can globally disable this feature by setting the jbo.viewlink.consistent to the value false in your configuration. Conversely, you could globally enable this >feature by setting jbo.viewlink.consistent to the value true, but Oracle does not recommend doing this. Doing so would force view link consistency to be set >on for view objects with secondary entity usages that are not marked as a reference which presently do not support the view link consistency feature well.Now i am thinking to set it false.. but as doc says but Oracle does not recommend doing this. Doing so would force view link consistency to be set on for view objects with secondary entity usages that are not marked as a reference which presently do not support the view link consistency feature well,
    With what option should i go...?
    go with separate eo and vo..?
    Regards,
    Santosh.

  • Entity object with Step by step explanation

    Dear friend,
    i want to make entity object using ADF framework anyone can give me the PDF or URL

    Are you talking about ADF BC entities:
    http://www.oracle.com/technology/obe/obe11jdev/bulldog/ria_application/developriaapplication_long.htm
    Or JPA entities:
    http://www.oracle.com/technology/obe/obe11jdev/bulldog/ejb_jpa_jsf/ejb.html
    Both and other tutorials are linked from the tutorials link here:
    otn.oracle.com/jdev

  • View Object with User Defined Type input

    I am trying to use a View Object with a query that requires a user defined object as an input parameter.
    I have the query working with a PreparedStatement, but would like to use a View Object.
    When I use the PreparedStatement, I prepare the user defined type data like this:
    // get the data into an object array
    Object[] wSRecObjArr = wSRec.getObjectArray();
    // set up rec descriptor
    StructDescriptor WSRecDescriptor = StructDescriptor.createDescriptor("WS_REC",conn);
    // populate the record struct
    STRUCT wSRecStruct = new STRUCT(WSRecDescriptor,conn,wSRecObjArr);
    Then I can use this in the PreparedStatement like this:
    OraclePreparedStatement stat = null;
    ResultSet rs = null;
    stat = (OraclePreparedStatement)conn.prepareStatement("Select test_pkg.test_function(?) FROM DUAL");
    stat.setSTRUCT(1, wSRecStruct);
    rs = stat.executeQuery();
    I would like to do the same process with a View Object instead of the PreparedStatement.
    My question is "How do I create the input objects"?
    I obtain the View Object from the Application Module using findViewObject(). I don't actually have a connection object to pass into the StructDescriptor.createDescriptor method.
    I have tried just using Java Object Arrays (Object[]) to pass the data, but that gave an error:
    oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation.
    Any help or pointers are greatly appreciated.
    Thank you.
    Edited by: 942120 on May 1, 2013 8:45 AM
    Edited by: 942120 on May 1, 2013 8:46 AM
    Edited by: 942120 on May 1, 2013 9:05 AM
    Edited by: 942120 on May 1, 2013 9:06 AM

    Custom domains are the way to go.
    When I try to pass custom domains that represent my user defined types - it works.
    However, one of the functions requires a table of a user defined type be passed in.
    I tried creating a domain of the table type. It forces me to add a field during creation (in JDEV), so I tried adding a field of type Array of Element of the domain representing the user defined type.
    I populate the table by setting the field I created, but the table is empty in PL/SQL (TEST_TAB.COUNT = 0).
    I also tried passing the oracle.jbo.domain.Array object, but that produced an error:
    java.sql.SQLException: ORA-06553: PLS-306: wrong number or types of arguments in call
    I also tried passing Object[], but that produced an error:
    oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation.
    How do I properly create, and pass an domain that represents a table of a user defined type?
    When I use a OraclePreparedStatement, I can pass a oracle.sql.ARRAY using stat.setARRAY.
    Thank you for the help you have provided, and any future advice.
    JDEV 10.1.2.3
    JDBC 10.2.0.5
    Edited by: 942120 on May 13, 2013 7:13 AM
    Edited by: 942120 on May 13, 2013 7:16 AM

  • 2d object with multiple primitive types

    I've done some research and tried a few options and finally decided that I want a two dimensional object to handle several different types of primitives. My current plan is to just put them all in a 2d String array, then parse them to whatever type I need when I need to do calculations with the integers or doubles. But I also wanted to ask if there was already an object type that could handle this for me without the parsing. I need more than one value per key, so I don't think that a map will work (although I've admittedly never used one before and may not fully understand how it operates).
    My other thought was to just make a new object with several different arrays of different types and to use the indices to relate one to another. This would at least clean up my code and take out some repetitive parsing steps, but it seems a very roundabout way to handle the situation.
    Any suggestions?
    Should I just use a 2d String array?
    Should I make a new object?
    Does an object already exist for this application?
    Also, if I muddied any of this up by using improper word choice, please let me know so that I can try to clarify.

    Fair enough. I'm working on analyzing some data for a videogame. I want to find the optimal set of items on a character by trying every combination and analyzing it's effectiveness. In order to do this, I want to store about a dozen different stats (some integers, some doubles) for about 30 different items along with the item's name, then use some nested loops to evaluate each combination. There is no 'perfect answer', so I need to perform this process multiple times under varying circumstances. I figure this would be easiest to accomplish if every stat is associated with an x value and every item is associated with a y value because I could then use the index of a for loop to process the information.
    In short, I have several different data types that I want to store in a manner that allows me to load and retrieve all the information using loops. Each set of data has the exact same format (String, int, int, double, double, double...).
    I know it doesn't sound like an important project, but I like to take any opportunity I can to practice my programming. I think it's an important skill in today's world and I'm always trying to improve.

  • Pricing condition settings with list cond type

    Hi all,
    I have a very urgent problem in pricing settings. We are in CRM 4.0 sp6 scenario linked to an ECC 5.
    In ECC 5 have been set some condition record that provide the field "list cond type" as blank. This are calculated in ECC but not in CRM that cannot read the blank as value.
    Any ideas?
    Very urgent.
    Thank in advance.
    Fabrizio

    Hello Fabrizio,
    Please refer 1010258 and see if this helps.
    Please reward some points.
    regards,
    Muralidhar Prasad.C

  • Looking for a better design: how to populate db result to object with lists

    I have a query that returns from the db an arrayList of class CarBean:
    carID, model, color, rentUserID, fname, lname, dateRentStart, dateRentEndThe query is with reference to a particular car that N people (rentUserID) rented and the user (the system user) wish to know how many rentals were made for this carID.
    I wish to populate the result into ONE class name CarRental which looks like this:
    private Car; //model
    private List<RentUser> rentals; //all info relating to rentUserso, my question is this, what creative way (Design Pattern, maybe?) is there to populate all the objects (CarBean) from the arrayList into CarRental?
    In my solution I'm doing something like this:
    Iterator<CarBean> itr = list.iterator();
    CarRental carRental = new CarRental();
    List rentals = new ArrayList();
    while (itr.hasNext())
        CarBean cb = itr.next();
        carRental.setCarID(cb.getCarID);
        //for the list of users:
       User u = new User(); 
       u.setUserID(cb.getUserID()); 
       rentals.add(u);
    carRental.setRentals(rentals);* please consider a more complicated query that the end result of ONE object should have X arrayList and other M objects in it
    thank you!

    Just to make sure I understand, here's a simple version of your question. Please correct anything I have wrong.
    Your design will have two classes: Car and Renter. A Renter is a Person who rents a Car on a given day:
    package model;
    public class Renter implements Serializable
        private Long id;
        private String name;
        private Address address;
        // Details left for you.
    }You'll also have a Car:
    package model;
    public class Car implements Serializable
        private Long id;
        private String make;
        private String model;
        private int year;
        // Details left for you.
    }It sounds like you want to have a one-to-many relationship between Car and Renter. I think you have a couple of choices:
    You can embed a List<Renter> as a data member inside the Car class, or
    You can encapsulate the relationship between a Car and a Renter in a separate class like a Contract.
    I kinda like the second option because it reifies a nice concept.
    As far as the database goes, I'd recommend following an idiom from Spring- their RowMapper interface:
    package persistence;
    public interface RowMapper
        Object map(ResultSet rs);
    }Encapsulate the mapping from ResultSets to Objects that way.
    Or use Hibernate, TopLink, or another ORM tool.
    %

Maybe you are looking for