Custom: use constant value in relationship between objects?

I have two related classes:
* Class A uses application identity, and has multiple PK fields, PK1 and
PK2.
* Class B has a 1-many relationship with class A. However, class B's
database table only has a column that relates to Class A's PK2 column.
(the PK1 value is a constant) for all Class B objects).
I have no idea how to express this relationship via kodo. Can anyone
assist?

What I've chosen to do is add a new DB column to my table which has a
constant value (ie: is the same for every row). Then I can join with it.
I'd request this simple feature to be added in a future release: the
ability to specify a literarl constant value as part of the join
criteria in the metadata. It could be very easily added: instead of
specifying a column containing the join value, you could put the literal
into the .jdo file.
thanks.
Patrick Linskey wrote:
You could put together a custom field mapping that performed the join
like you described if you really wanted to. Bear in mind, however, that
the field mapping APIs are subject to change etc. etc. etc.
-Patrick
On Tue, 20 May 2003 22:25:16 -0400, David Michaels wrote:
Thanks for the quick reply, as usual Abe.
In this case, I will link to the full PK of the related object, just one
of the components of that PK is a constant. There's no place to
override the SQL used for these sort of joins?
Perhaps I can do this with a view too.
Abe White wrote:
It's not possible to create a Kodo relation that doesn't actually link
to the (full) primary key of the related object. Note that in general,
that kind of database design is not a good idea, because there's no
guarantee you're linking to a unique object.
You can use a Kodo query to get the related objects; you could hide the
query behind your getter method.

Similar Messages

  • Relationship between Objects Not Found in PA

    Dear all,
    I have uploaded objects (Org Unit, Job, and Position) and the relationships between objects separately using LSMW.
    When i checked the update of the relationship between objects in PA30, but the relationship between objects (Org Unit, Job, and Position) did not exist, yet exists in PP02.
    I tried to upload the relationships between objects using holder (A008) in LSMW again, still I could not find the relationships in PA30, but exist in PP02.
    Then I tried to run rhinte00 and rhinte30 to link the relationship between objects. I managed to get through rhinte00, but failed to run rhinte30.
    Below is the report log when I tried to run rhinte30.
    Report log:   
    Processing mode:   Processing successful 
    Number of personnel nos. selected :   0 
    Personnel numbers with errors:

    Check the following.
    1. Check if integration is active in T77S0 table PLOGI PLOGI = Your active plan version & PLOGI ORGA = X
    2. Check if all your objects are created with this active plan version
    3. Check the feature PLOGI to see if your PA PSA etc for the employee are integrated.
    cheers
    Ajay

  • Relationship between Object Type QK & Q

    Can someone help here. I am trying to confirm if there is a relationship between object type QK (qualification group) & Q (qualification). I checked HRP1001 but did not seem to find a relationship between these two object types. Is there another table I need to check.
    Thank you.

    Hi,
    Have you checked A/B 030?
    Q A030 Is a specialization of QK
    QK B030 Is a generalization of Q
    The table for all relationships in general is T777E.
    Hope this helps.
    Donnie

  • Display relationships between objects

    I've been tasked/ proposed to deliver a new project involving
    two displayObjects... say 2 squares. Between those squares, I need
    to show a connecting relationship of hierarchy. So, I need to have
    a visual line connecting the 2 objects.
    Does anyone know if there is already a class for this in Flex
    or what I might use to demo this quickly. Never done this sort of
    data visualization before, but the math can't be to hard.

    "jwoozy" <[email protected]> wrote in
    message
    news:g96kmn$80o$[email protected]..
    > I've been tasked/ proposed to deliver a new project
    involving two
    > displayObjects... say 2 squares. Between those squares,
    I need to show a
    > connecting relationship of hierarchy. So, I need to have
    a visual line
    > connecting the 2 objects.
    >
    > Does anyone know if there is already a class for this in
    Flex or what I
    > might
    > use to demo this quickly. Never done this sort of data
    visualization
    > before,
    > but the math can't be to hard.
    >
    I think there is something here
    http://flexbox.mrinalwadhwa.com/,
    but I
    don't have time to search through it for you.
    HTH;
    Amy

  • Relationship between objects and information stored in a database

    I've got a question that's pretty broad... but maybe someone can help with it.
    I'm writing a couple of classes, one called "Customer" and the other "Store". Store can contain any number of customers, which it keeps in an array. A customer object has name and address fields, as well as an array of the current movies the customer has checked out. A third "Driver" class has the main method which calls the other two classes. When a new customer is created, it is put into the array in an object of store, and written to disk in a file named with the customer's ID number.
    My question is, I'm not really sure how objects tie in with the actual database on the hard disk. For example, if I run the program once and add 3 customers, all three get written to disk, and exist in memory as objects. However, when I exit the program, I lose all 3 of those objects from the array of customers in the store object.
    So, when I run the program a second time, the array is gone, though the customer information remains on disk. I have methods to delete/add customer objects to an object of store, but those don't do me any good without the array in memory. I thought that I could just load all data from disk, and put them back into the array, but isn't that inefficient if the database is very large? Is there a better way to deal with this?
    I hope that was reasonably clear. I'd appreciate any help. Thanks.

    i would make the store a manager of the customer objects whose
    responsibilities include read and writing the objects as well as caching
    them.
    here is some sample code for this.
    public class Customer(){
      int id;
      /* the id field is the unique identifier for each Customer.
         this field should probably be our primary key in our database
         table. you don't have to use a number but whatever it is it
         needs to be unique */      
      boolean updated;
      public Customer(int customerId){
        id = customerId;
        updated = false;
      public int getCustomerId(){
        return id;
      /* if the customer object has been changed and needs to flushed back
         to the database this returns true. */
      public boolean needsFlushing(){
        return updated;
      /* and your other methods go here... */
    }and now for the Store...
    public class Store{
      private Customer[] cache;
      public Store(){
        cache = new Customer[10];
        /* here i have hard coded as 10, you could change this or for more
           flexibility use a Vector or such. */
      /* spin through the cache and return the matching customer. if the
         customer is not in the cache load it in the database. */
      public Customer getCustomer(int customerId)throws SQLException{
        for(int j=0;j<cache.length;j++){
          if((cache[j]!=null)&&(cache[j].getCustomerId()==customerId)){
            return cache[j];
        Customer c = loadCustomer(customerId);
        addToCache(c);
        return c;
      public void addCustomer(Customer c)throws SQLException{
        /* adds a new (non-existing customer) */
        saveCustomer(c);
        addToCache(c);
      public void close()throws SQLException{
        /* flushes back any updated customers */
        for(int j=0;j<cache.length;j++){
          if((cache[j]!=null)&&(cache[j].needsFlushing())){
            saveCustomer(cache[j]);
        cache = null;   
      private Customer loadCustomer(int customerId)throws SQLException{
        /* here would be code for loading a customer object from the
           database that matches the customerId. */
        return new Customer(customerId);//temporary 
      private void saveCustomer(Customer c)throws SQLException{
        /* here would be the code for saving the customer c into the
           database */
      private void addToCache(Customer c){
        /* this method adds the customer c to the cache. it may have to
           to remove an older customer from the cache to do this. i leave
           the algorithm for deciding this up to you */

  • Using constant values in SQL Loader control file

    Hi,
    I have a requirement where I need to migrate the data of 6 tables from MS Access into Oracle data base. I have written SQL Loader scripts so that I can create CSV files based on MS Access data and then migrate into Oracle. But in Oracle tables we have 4 common columns like Create_By, Created_Date,Updated_By and Update_Date, and those fields should be taken care by system. So, basically system should update login user ID and sysdate values in respective columns. My question here is, I do not have above mentioned common columns in MS Access tables. So, can I hard code those values in control file by saying
    Created_By CONSTANT user,
    Create_Date CONSTANT TO_CHAR(SYSDATE,'MM/DD/YYYY HH24:MI:SS'),
    Updated_By CONSTANT user,
    Updated_Date CONSTANT TO_CHAR(SYSDATE,'MM/DD/YYYY HH24:MI:SS')
    Please let me know your valuable suggestions.

    You do it without it constant
    --sample data file
    1,2,,
    3,4,,
    LOAD DATA
    INFILE 'D:\d.csv'
    INTO TABLE ABC
    FIELDS TERMINATED BY ","
    ( A,
      B,
      C sysdate,
      D "USER"
    )Edited by: J99 on Jul 23, 2009 12:14 PM
    OR use to avoid extra ',' in datafile.
    --sample data file
    1,2
    3,4
    LOAD DATA
    INFILE 'D:\d.csv'
    INTO TABLE ABC
    FIELDS TERMINATED BY "," TRAILING NULLCOLS
    ( A,
      B,
      C sysdate,
      D "USER"
    )

  • How do I create parent/child relationship between objects? so that if I change one, I change all

    I have multiple instances of an object, and I would like to make any changes that I put on one of these objects to perpetuate and change on the other instances of the object

    turn your object into a symbol, and place multiple instances of it on the artboard, when you edit the symbol all instances will update.

  • Creating custom mappings between objects

    I currently have a db schmea that supports "soft" deletes. Example:
    Client table has fields:
    id - primary key (number)
    name - varchar
    active ("Y" or "N" where "Y" means active and "N" means "INACTIVE")
    We also have a table Users:
    id - primary key (number)
    name - varchar
    active ("Y" or "N" where "Y" means active and "N" means "INACTIVE")
    When I delete a user I want to set its active field to "N" and then when
    someone reads users from the client (after I have saved my changes) I want
    only users whoses active field is "Y" to be returns, i.e.
    Client clientA = <read client A>
    Collection users = clientA.getUsers();
    Is there a way to configure/customize the mapping/relationship between
    objects?
    Thanks!
    Bruce

    All of the emails are really my way of getting a soft delete to work. Does
    KODO support this feature or is their a standard work around to support
    this feature?
    Thanks!
    Bruce
    Alex Roytman wrote:
    You could break you collection into multiple mutually exclusive
    subcollections (like active/inactive) and have your object model to map them
    separately (via views with mutually exclusive criterion) When changing a
    collection member's status you will need to move it from active collection
    to inactive. Complete collection can be dode as dybamic (delegating)
    composition of the subcollections (but it will cost twice as much to fetch
    it)
    Try to resolve your issues on object model level. I believe altering sql
    mappings to make them very fancy will cause you lots of grief in the long
    run
    "Bruce" <[email protected]> wrote in message
    news:[email protected]...
    I also want to do something similiar to support object history. I could
    have a Client object which gets modified and instead of editing this
    object I would copy it, inactivate the copy and then edit the original.
    This allows for full history. I can always select by active (or a more
    complicated status) to get the rest of the history instead of the "top".
    Views here seems like a hack. I have activew fields in all of my tables so
    I would nee views for each table which is a lot to manage if fields are
    changing (need to change them in both places). Also this creates issues
    since views are really read-only.
    Isn't there a way to change the SQL used to read a relationship?
    Bruce
    Alex Roytman wrote:
    map your classes against views with (where active = 'Y') to make sure
    "soft
    deleted" records do not get read and have your object model to handlesoft
    deletes (like removing from collections etc) use helper methods to do"soft
    deletes" masking real deletes is not good idea - you will need them atsome
    point
    "Stephen Kim" <[email protected]> wrote in message
    news:[email protected]...
    While there is nothing default that does particularly what you desire,
    but from my perspective, you should not have Kodo do anything by
    default
    as you will probably want to delete the inactive instances at somelater
    point.
    Instead you should look into Query.setCandidates:
    http://www.solarmetric.com/Software/Documentation/2.4.3/docs/jdo-javadoc/jav
    ax/jdo/Query.html
    i.e. public Collection getActiveUsers ()
    PersistenceManager pm = JDOHelper.getPersistenceManager
    (this);
    Query q = pm.newQuery (User.class, true);
    q.setFilter ("active == "N"");
    q.setCandidates (users);
    return q.execute ();
    I haven't tested the above code and there are a lot of optimizations
    you
    could do such as caching the query in a transient collection but Ithink
    you get the idea.
    You may want to post your thoughts on our newsgroups
    (news://news.solarmetric.com) and see how other people are tackling
    similar probles..
    Bruce wrote:
    I currently have a db schmea that supports "soft" deletes. Example:
    Client table has fields:
    id - primary key (number)
    name - varchar
    active ("Y" or "N" where "Y" means active and "N" means "INACTIVE")
    We also have a table Users:
    id - primary key (number)
    name - varchar
    active ("Y" or "N" where "Y" means active and "N" means "INACTIVE")
    When I delete a user I want to set its active field to "N" and then
    when
    someone reads users from the client (after I have saved my changes)I
    want
    only users whoses active field is "Y" to be returns, i.e.
    Client clientA = <read client A>
    Collection users = clientA.getUsers();
    Is there a way to configure/customize the mapping/relationship
    between
    objects?
    Thanks!
    Bruce
    Stephen Kim
    [email protected]
    SolarMetric, Inc.
    http://www.solarmetric.com

  • Constant values in EJBQL

    Hi.
    I'm trying to define some finder methods for my application using constant values instead of parameters.
    The bean has a java.lang.Boolean CMP field named Finished, and I want to define a findAllFinished() method. I try something like this:
    SELECT Object(o) FROM Works o WHERE o.Finished=true
    but it doesn�t work. I suppose it is because the field is java.lang.Boolean instead of boolean, so how can I specify a java.lang.Boolean constant value?

    I have tried the test case in my environment. It is working for me.
    Do you see any error message in server.log during deployment or runtime?

  • Many to many relationships between Fact and Dimension

    Hi All,
    I have to solve two kind of many to many relationships between Fact and Dimension.
    1. Many to Many relationship between Fact and Dimension, using a bridge table, with FKs in fact and dimension to bridge table’s PK.
    2. Many to Many relationship between Fact and Dimension, using a bridge table, and an intersection table, with FK in fact to bridge table, and 2 FKs in intersection table to Dimension and to bridge table.
    I need help on implementing (how the mapping has to look like) them in OWB 9.2.0.2.8.
    Thanks,
    Aurelian Cojocaru

    Aurelian,
    Unfortunately, you cannot implement this in the dimensional model. You would have to use relational tables and relationships between those in order to implement your scenario.
    Thanks,
    Mark.

  • Relationship btween object in h.r

    hellow i have a work in hr (abap)and i wont to learn about the relationship between objects in h.r like(objid,sobid,pernr...). if some one now about pdf or something else that can help i will  appraise it .
    (some one told me about the book hr 50 but i dont have it so i dont now) thanks ahead .

    Hi,
    The pdf in the following link gives an overview of org. object and their relationshipd. For detailed help refer help.sap.com.
    http://www.purdue.edu/onepurdue/contribute_pdf/overview-of_om_objects.pdf
    Thanks,
    Prasath N

  • Tables used for relationship between BP customer and BP Sales employee

    Can annybody tell me what tables contain the relationship between customers and sales employee.
    Or what tables are used by the BDOC BUPA_REL ?
    Thanks for your input.

    In table BUT050 you can find relationships between business partners.

  • Adding new constant value to an 'enum' used in a field causes an exception

    We are using the DPL. I added a new constant to an enum that is used as a field on an entity called Booking (this field is not a key). This seems to cause an exception during onForeignKeyDelete when we delete an object from a related entity. The constraint is a "NULLIFY" on a "MANY_TO_ONE" relationship, so the effect should be just to nullify the Booking foreign key, but for some reason the fields are being checked and causing this exception. Shouldn't it be possible to add a new constant value to an enum without having to do some sort of migration? The stack is below. Note that the two types mentioned in the exception message are in fact the same (this is the enum). For the moment we can truncate our database, because we are still in development, but this would present a problem in production.
    IllegalArgumentException: Not a subtype of the field's declared class com.chello.booking.model.BookingStatus: com.chello.booking.model.BookingStatus
    at com.sleepycat.persist.impl.RawAbstractInput.checkRawType(RawAbstractInput.java:142)
    at com.sleepycat.persist.impl.RecordOutput.writeObject(RecordOutput.java:75)
    at com.sleepycat.persist.impl.RawAccessor.writeField(RawAccessor.java:232)
    at com.sleepycat.persist.impl.RawAccessor.writeNonKeyFields(RawAccessor.java:148)
    at com.sleepycat.persist.impl.ComplexFormat.writeObject(ComplexFormat.java:528)
    at com.sleepycat.persist.impl.PersistEntityBinding.writeEntity(PersistEntityBinding.java:143)
    at com.sleepycat.persist.impl.PersistKeyCreator.nullifyForeignKeyInternal(PersistKeyCreator.java:170)
    at com.sleepycat.persist.impl.PersistKeyCreator.nullifyForeignKey(PersistKeyCreator.java:137)
    at com.sleepycat.je.SecondaryDatabase.onForeignKeyDelete(SecondaryDatabase.java:1082)
    at com.sleepycat.je.ForeignKeyTrigger.databaseUpdated(ForeignKeyTrigger.java:37)
    at com.sleepycat.je.Database.notifyTriggers(Database.java:2016)
    at com.sleepycat.je.Database.deleteInternal(Database.java:800)
    at com.sleepycat.je.Database.delete(Database.java:714)
    at com.sleepycat.persist.BasicIndex.delete(BasicIndex.java:133)
    at com.sleepycat.persist.PrimaryIndex.delete(PrimaryIndex.java:206)
    at com.sleepycat.persist.BasicIndex.delete(BasicIndex.java:124)
    at com.sleepycat.persist.PrimaryIndex.delete(PrimaryIndex.java:206)
    Kind regards
    James Brook

    James,
    I've started investigating this and at first look it does appear to be a DPL bug. Over the next few days I'll look more deeply and report back here with what I find. If it is indeed a bug, we'll fix this for the next JE 4.0.x release and I'll make the fix available to you.
    You are correct that adding enum values is allowed without a conversion of any kind. The only change you should have to make, other than adding the enum value, is to bump the version of the containing entity in the @Entity annotation. I'm suspect you've already done that, but if you hadn't, it wouldn't cause the problem you're seeing.
    We have tested the addition of enum values, but not in combination with foreign key deletion and the NULLIFY constraint, I'm afraid.
    If I'm correct about it, the bug is specific to adding enum values and deleting a secondary key with the NULLIFY constraint, prior to re-writing the entity in some other way. So if the entity is updated (written) before the secondary key is deleted, then the problem should not occur. Therefore, one workaround is to call EntityStore.evolve after adding the enum value, and before using the store in other ways.
    Thanks for reporting this, and I hope this is not blocking your development.
    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Error while adding a used relationship between the New DC and the Web DC

    Hi Gurus
    We are getting the Error in NWDS while Adding  a used relationship between the New DC and the Web DC.
    Steps what we are Done
    1. Create the custom project from inactiveDC's
    2.creating the project for the component crm/b2b in SHRAPP_1
    3.After that we changed the application.xml and given the contect path.
    4.Then we tried to add Dependency to the custom create DC we are getting the error saying that illegal deppendency : the compartment sap.com_CUSTCRMPRJ_1 of DC sap.com/home/b2b_xyz(sap.com.CUSTCRMPRJ_1) must explicitly use compartment sap.com_SAP-SHRWEB_1 of DC sap.com/crm/isa/ like that it was throwing the error.
    so, we skip this step and tried to create the build then it is saying that build is failed..
    Please help us in this regard.
    Awaiting for ur quick response...
    Regards
    Satish

    Hi
    Please Ignore my above message.
    Thanks for ur Response.
    After ur valuble inputs we have added the required dependencies and sucessfully created the projects, then building of the  projects was also sucessfully done and  EAR file was created.
    We need to deploy this EAR file in CRM Application Server by using the interface NWDI.
    For Deploying the EAR into NWDI, we need to check-in the activites what i have created for EAR. once i check-in the activites ,the NWDI will deploy the EAR into CRM Application Server.
    In the Activity Log we are able to check the Activities as Suceeded but the Deployment column is not showing any status.
    When i  right click on my activity Id the deployment summery is also disabled.
    So finally my Question is that where can i get the deployment log file, and where can i check the deployment status for my application..
    Any pointers in this regard would be of great help..
    Awaiting for ur valuble Responses..
    Regards
    Satish

  • Additional data on relationship between two objects

    Hi
    We have a requirement to capture additional data on a relationship between two objects.  The data to be captured are custom fields that are unique to the relationship between the objects and not specific to either of the objects.
    We created a new object type and related it to the position (S)and the job (C) object.  In the customising (Personnel Management/Personnel Development/Basic Settings/Maintain Relationships there is an option to set up Additional Data.  There are however several restrictions (e.g. the substructure has to be in T77AD).  When you set up an existing substructure (e.g. PAD22) and screen (e.g. 3000), it works really well, however we have not been able to get this to read our own substructure and screen (since there is no customer include on HRP1001 and the 'Additional data' button seems to go to MP100100 to find the screen).
    My question is two fold:
    a) Is this an allowed customisation (e.g. can we create our own substructure, screen and Query string)? And if so, how does the data get into T77AD (since SAP recommends that data should not be added to this table)? and
    b) Is there any documentation on this (thus far I have only received info on how to enhance infotypes which I don't think is relevant???)?
    If this can not be maintained is there any other suggestions on how to deal with this scenario?
    Any assistance will be appreciated.
    Regards
    Liezl

    Hi everyone
    Thanks for everyone who tried to assist us with this.  I am happy to report that our in-house guru's have found the answer.  So, for anyone who is interested:
    In programme MP100100 you have a screen 6000 which is a customer enhancements screen.  We set up two in-house function modules for the PBO and PAI with its own screen and added an append structure to PAD31 to add the fields required.  In the configuration, we then specified PAD31 as the substructure with screen 6000 and then also specified our own PBO and PAI function modules.  The parameters required for screen 6000 is set up within our own customer screens.
    Hope this will be helpful to someone - it certainly seemed to open up some doors for us!
    Regards
    Liezl

Maybe you are looking for

  • For Each File in a Folder

    I'm just trying to do something with each file in a particular folder. Is there already a Fuego object for doing this? If not, what are my other options?

  • How to calculate the slope of a signal to find its peak

    I have acquired a ECG signal through the DAQ. Actually I have to calculate the slope of the ECG signal in order to find the R-peak. By finding the slope of R- wave which will be greater than the slope of T-wave, I could differentiate between R-wave a

  • Formatting series markers

    Post Author: Sriram Venkataramani CA Forum: Charts and Graphs Hi,I have a crystal report with a stacked bar chart. For one of the series in the chart I want to shown only dash(-) markers instead of showing it as a riser. So what I did was to change t

  • Unable to login @ login window with Active Directory User

    I successfully bound my test machine to Active Directory and can search using dscl and id. I can also su to my active directory user account an authenticate perfectly. All search bases are correct and everything else looks fine. When I attempt to log

  • LAGGING ON TIMECAPSULE

    Hi, i have a 500GB TCapsule & its taking so long & laggs really badly ,It takes a longtime ,like,wen I go backwards in time on the timeline down the right hand side,it laggs& gets kinda stuck for about 4-5 mins sometimes ,i have just over 250GB of sp