How shall we do validation for Unique Key and Multiple Primary Key?

Hi,
I have table created From EO in which one column is checked as Unique.
How to do validation for column checked as Unique.
I know how to do validation for column checked as primary key.
Below is sample code for primary key validation
if (getRvSize() != null)
throw new OAAttrValException(OAException.TYP_ENTITY_OBJECT,
getEntityDef().getFullName(), // EO name
getPrimaryKey(), // EO PK
"RvSize", // Attribute Name
value, // Attribute value
"AK", // Message product short name
"FWK_TBX_T_EMP_ID_NO_UPDATE"); // Message name
if (value != null)
OADBTransaction transaction = getOADBTransaction();
Object[] rvKey = {value};
EntityDefImpl rvDefinition = xxczVAGCSRVSizingEOImpl.getDefinitionObject();
xxczVAGCSRVSizingEOImpl rv =
(xxczVAGCSRVSizingEOImpl)rvDefinition.findByPrimaryKey(transaction, new Key(rvKey));
if (rv != null)
throw new OAAttrValException(OAException.TYP_ENTITY_OBJECT,
getEntityDef().getFullName(), // EO name
getPrimaryKey(), // EO PK
"RvSize", // Attribute Name
value, // Attribute value
"AK", // Message product short name
"FWK_TBX_T_EMP_ID_UNIQUE"); // Message name
What changes need to be done for above code in order to do the validation for Unique Key.
I have one more Question
How shall we do the Validation for Multiple Primary Key in a table?
- Mithun

1. If you just validate on one attribute like your unique key, then put your logic in the set<Your AttributeName) method
2. If you want to do the cross validation ( like validating multiple attributes) then put your logic in the validateEntrity Method
How to do that?
1. Create a Validation View object.
2. Associate your VVO to the VAM
3. Create entity expert.
4. Have method in entity expert for your validation (you would be calling AM and then VO execute the query and do the validation.
5. You would be calling the Entity experty method from your EO either setMethods or validateEntity.
I have given just the high level points.
Hope this helps.
Thanks,
RK

Similar Messages

  • Creating a single public key and multiple private keys

    Hello,
    I am new to java cryptography. The problem statement is :-
    We have an accounting application, with flexibility of number of users and companies. The number of users and companies for this application has to be restricted based on the license the user has. That is the user will download our application via web while the user downloads he has to be given the key according to the license he has requested (i.e. single or multiple users/companies), I am unable to get the logic of private and public keys as such, y because which ever alogorithm i saw will generate a public and private key in pairs hence i am bit confused. Clearly, For ever additional user (or company) we r charging additional amount hence different license (keys) have to be generated dynamically for different users. I think this can be achived by creating one single public key and multiple private keys, but i am not sure . Please help me out.

    Hi kazim
    would u pls elaborate this , since i am working on same kind of scenario and finding solutions is difficult . Since encryption is done at our end and wen some user downloads an application he is unable to track where it was encrypted . What i have undestand about public /private is that they work in agreement between client and server and both has to come to agreement to share the data. Pls correct me if i am wrong.
    Ours is different senario we will send some key in download application and will want him to decrypt it . What would u suggest for this kind of scenario?
    Thanks in advance
    Janesh

  • Validation for Unique Name and Non-AlphaNumeric Characters

    Hi All,
    How to do Unique name and Non-Alpha Numeric Characters Validation?
    Name should be unique and only allow alphanumeric characters.
    Where all validations must be done? In EOImpl or any other file?
    Plz help
    Thanks,
    Sk

    SK
    Here are the steps you need to perform to check duplicate Employee Names need not entered by user.
    First create a VVO in your schema.server package(that of EO) with the following query.Generate both VVOImpl and VVORowImpl file.
    select full_name
    from fwk_tbx_employees
    where full_name =:1Now add this VVO to your VAM means give instance to it.
    Now open the VVOImpl and write below code to execute query based on new name entered by user
        public void initQuery(String name)
          setWhereClauseParams(null); // Always reset
          setWhereClauseParam(0, name);
          executeQuery();
        }Now open Your Entity Expert class and add below method in it
       public boolean isEmployeeNameExists(String name)
         boolean isExists = false;
               // Note that we want to use a cached, declaratively defined VO instead of creating
               // one from a SQL statement which is far less performant.
         EmployeeNameVVOImpl employeeNameVVO =
           (EmployeeNameVVOImpl)findValidationViewObject("EmployeeNameVVO1");
         employeeNameVVO.initQuery(name);
         // We're just doing a simple existance check.  If we don't find a match, return false.
         if (employeeNameVVO.hasNext())
           isExists = true;
         return isExists;
       }Now you need to call this expert class method from setter method of EOImpl for name.so Open your EOImpl file and go to setter method of name
          if ((value != null) || (!("".equals(value.trim()))))
            EmployeeEntityExpert expert = getEmployeeEntityExpert(getOADBTransaction());
            if (!(expert.isEmployeeNameExists(value)))
                throw new OAException("Duplicate Employee Name", OAException.ERROR);
          }Remember to write code above setAttributeInternal.
    Hope it helps!!!!
    Let me know if you have queries in it.
    Thanks
    AJ

  • What index is suitable for a table with no unique columns and no primary key

    alpha
    beta 
    gamma
    col1
    col2
    col3
    100
    1
    -1
    a
    b
    c
    100
    1
    -2
    d
    e
    f
    101
    1
    -2
    t
    t
    y
    102
    2
    1
    j
    k
    l
    Sample data above  and below is the dataype for each one of them
    alpha datatype- string 
    beta datatype-integer
    gamma datatype-integer
    col1,col2,col3 are all string datatypes. 
    Note:columns are not unique and we would be using alpha,beta,gamma to uniquely identify a record .Now as you see my sample data this is in a table which doesnt have index .I would like to have a index created covering these columns (alpha,beta,gamma) .I
    beleive that creating clustered index having covering columns will be better.
    What would you recommend the index type should be here in this case.Say data volume is 1 milion records and we always use the alpha,beta,gamma columns when we filiter or query records 
    what index is suitable for a table with no unique columns and primary key?
    col1
    col2
    col3
    Mudassar

    Many thanks for your explanation .
    When I tried querying using the below query on my heap table the sql server suggested to create NON CLUSTERED INDEX INCLUDING columns    ,[beta],[gamma] ,[col1] 
     ,[col2]     ,[col3]
    SELECT [alpha]
          ,[beta]
          ,[gamma]
          ,[col1]
          ,[col2]
          ,[col3]
      FROM [TEST].[dbo].[Test]
    where   [alpha]='10100'
    My question is why it didn't suggest Clustered INDEX and chose NON clustered index ?
    Mudassar

  • How to maintain, the validity internal when we use non commulative key figu

    Hi Friends,
    I would like to check, I've created query on Inventary infocube, when we trying to execute the report, I'm getting the following error.
    The validity internal has the initial value as lower limit
    Generally, How we will maintain validity internal when we use non cumulative key figures.
    Can anybody have some idea about this.
    Siri

    You need to maintain the validity period on which your stock can be calculated. The user will see special values when asking for stock outside this period (don't remember the special value).
    It can be a fixed period (in a first step, I will recommend that). For instance : from 01.01.1000 to 31.12.9999. Thus you will never have any error.
    It can also be a dynamic period (generally linked to the last data load).
    Regards,
    Fred

  • How to create a validation for the project coding mask

    Hi,
    Would just like to ask how to create a validation for the project coding mask wherein the WBS elements hierarchy will be checked against the template saved. For example,
    project coding mask is XXXX-XXXXX-XX-X-X-X-00-X
    mother WBS should be XXXX-XXXXX-X and lower level WBS would be XXXX-XXXXX-XX.
    The validation should not allow a mother WBS to be XXXX-XXXXX-XX.
    How can we go about this?

    Hi Jacquiline Bersamin,
    You can use validation with the combination of the level and the coding mask.
    In the validation:
    Pre requisite: WBS level = 1
    Validation: Prps-posid = prps-posid :1-12:
    Message : Error
    If required you can give the parameters for your detail error message.
    Please let me know if this does not work.
    Thanks
    Regards
    Srinivasan Desingh

  • How to do the validation for a checklist item

    I have a check item which is a date which should not allow future date. This check list item might be 1 st item or 10th or 3rd .. depending on the selection made in the previous page. How can i do validation for this item ?
    thanks for your help.

    Hi, I am not sure of the table though for the budget, but I have one suggestion.. I'm not sure if you already know the F1-F9 button. Firstly, just put your cursor somewhere in the screen where the budget/field is located then press F1 and F9, you will see the table name, go to t-code SE11 and type in the table you've found, then go to attributes and copy the development class, open a new session using t-code SE80(Object navigator), pull down the arrow/F4 choose the development class and press the ENTER button, you will see all the related tables, function modules, transaction, programs, etc., that is related to that development class. 
    Hope this helps. =)

  • How can I put validation for JTextField when gotfocus and lostfocus

    Hi,
    How can I put validation for JTextField when gotfocus and lostfocus ?
    Thanks
    Wilson

    You add a focusListener to the control you wish to monitor. In the focusLost() handler you do whatever, in the focusGained() handler you do whatever.

  • How to get client side validation for double range and double field in stru

    Hi,
    I have achieved client side validation by using <html:javascript formName=""/>
    All fields shows client side validation but double field and double range field is not shows client side validation but shows server side validation.
    I am using Liferay jboss server.
    Please tell me a way to achieve client side validation for double field and double range.
    Thanks & Regards,
    Brijesh Baser

    I see in the query component there is a QueryListener and a QueryOperationListener. Have you tried letting Jdeveloper create methods for these in some backing bean, and putting in some debug code to see when these methods run? I would think one of them could very well be used to validate the input, somehow; if the input were bad you could just raise an exception and pass your error message, I bet.
    If not...
    I am pretty sure that there is an appendix in the Fusion Developer's Guide for Forms developers turned to Java...you might look at what it says for post query. I know in the 10.1.3.0 equivalent documentation, they gave reference to a method in the ViewObject which fired for each record after a query was run. You could definitely intercept this query return from there. In fact doing something like this may be something like what Frank N. was intending when he mentioned ViewObjects "validation". Not sure though. I am still learning what new features there are in 11g adf/bc.
    Good luck.

  • Validation for Project defination and project profile

    Hello,
    I have to create validation for Project Definition and Project Profile.User requirement is when the project (Exp: Z/0120) is creating with project profile Exp: Z0001_Z system should allow , If user is trying to select other than this profile system has to give the error.
    I tried below validation but it is not working:
    Prerequisite - PROJ-PSPID = 'Z'
    Check   -  PROJ-PROFL = Z0001_Z
    Kindly any suggest how can i give the validation for the same.
    Regards,
    Lakshmi.
    Message was edited by: Mohamed Rafi - Many threads available on this topic search for those.

    Hi,
    Have you tried to save the project? Because validation rule will call at time of saving the Project.
    I have created the same but for start with 'U'
    When I create project and at time of saving, validation rule will call and system throw error if I don't create project start with 'U'.
    Now If I am creating here, start with 'J'. System  is throwing error as per validation rule.
    Also Pl check if you have assigned same correct rule on project profile.
    Regards
    Shishir

  • Validation For Date,String and Date in a reports Region

    Apex 4
    Good day to all apex users How do I validate a apex_item.text if the value is string the user can only input a string value if it is number then the user can input numbers only and if it is a date the user can only input a date values?

    APEX_ITEMS are not part of the default apex gui... In fact they are just functions which returns html.
    You can however do some stuff with the attributes parameters. You can find some cool stuff over here: Re: Validation For Date,String and Date in a reports Region
    If you want apex validation you need to create a page validation and loop over your apex_items with apex_application.g_f0x
    Br,
    Nico

  • Is There a List of Keyboard Shortcuts for Adobe Digital Editions, I Found Two By Accident the "Arrow" Keys and the "Enter Key" for Turning Pages in an eBook...

    Hi  ??  :       Does Anyone Know If There is a List of Keyboard Shortcuts for Adobe Digital Editions, I Found/Discovered Two By Accident the “Arrow” Keys and the “Enter Key” for Turning Pages in an eBook...   Thanks
    I Did Look for this Keyboard Shortcuts in Adobe Digital Editions Help & FAQ Areas and Got the Run Around, Very Hard to Find How Use Adobe Products !!
    Microsoft Windows Vista & Win 7 Operating Systems
    Message was edited by: Al Adams

    Nope, I doubt it.  As I said:
    I disabled Aero theme, checked font scaling was 100% and rebooted Windows in between all of the steps to no avail.
    I've been reading a lot around this and it seems the arrow key problem is a red herring; I think it's just some kind of terminal preferences corruption.

  • How to transport the validations, assignments, named searches, and workflow

    Hi Experts
    How to transport the validations, assignments, named searches, and workflow
    between two repositories.
    Thanks
    Vickey.

    Hi Vickey,
    In MDM 5.5 you can use the Archive /Unarchive option for it
    You can refer the below link:
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/20751e78-f81f-2a10-228f-eb3a16421b4d(Export/Import Schema)
    Note:Export/Import schema can also be used for Transportation in MDM however as of MDM 5.5 the maps,validations and workflows cannot be transported.
    From MDM 7.1 version onwards you can use the Export/Import Schema as well
    You can refer the below link:
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d0dd1ae0-36e5-2b10-f8b4-e6365e643c0b
    Hope It Helped
    Thanks & Regards
    Simona Pinto

  • How to integrate bing map for including or displaying multiple locations at the same time

    how to integrate bing map for including or displaying multiple locations at the same time

    Have you aware of the geolocation field that's been introduced with SharePoint 2013?  You can store location data within a list and then integrate this within Bing.  The second tutorial on this Bing team blog will show it well.
    https://www.bing.com/blogs/site_blogs/b/maps/archive/2013/03/26/connecting-a-sharepoint-list-to-bing-maps.aspx
    Steven Andrews
    SharePoint Business Analyst: LiveNation Entertainment
    Blog: baron72.wordpress.com
    Twitter: Follow @backpackerd00d
    My Wiki Articles:
    CodePlex Corner Series
    Please remember to mark your question as "answered" if this solves (or helps) your problem.

  • Validation for Profit Center and Trading Partner

    Hi Gurus,
    Please help me in creating validation for Profit Center and Trading Partner.
    I want system to give an error if we use Trading Partner related to particular profit centers.
    Please revert asap.
    Thank You

    Hello,
    Please use T.code OB28 and select the call up point 2.
    Than go to Prerequisite in expert mode and say
    Prerequisite  :           BSEG-VBUND <> ' '
      Check:               BSEG-PRCTR = ' '
      Error Message.: xyz
    I have created Validation understanding if someone gives Trading Partner and also Profit center while posting a doc than it will generate an error message.
    however if you have some diff req please change it accordingly/ take Abapers helps if not very clear.
    I hope this helps
    Regards
    Shireesh

Maybe you are looking for