Accessing interfaces in JPA

Hi!
I have some JPA Entities that are part of various separate persisted class hierarchies. I want to be able to have just some of them be referenced from another entity, namely those that implement a specific interface. It's not hard to see how it could be done at the database level, where I can have the referencing entity hold an id column and a discriminator column. However, I see no way to annotate which object should be created from which discriminator value when the class hierarchies are separate and persisted with joined inheritance.
Here is a simplified example:
@Entity
@Table(name="ValueSeriesConfig")
@Inheritance(strategy = InheritanceType.JOINED)
public class ValueSeriesConfig {
  @Id
  protected long id;
@Entity
@Table(name="CalculationConfig")
public class CalculationConfig extends ValueSeriesConfig implements EventGenerator {
@Entity
@Table(name="ReadingSeriesConfig")
public class ReadingSeriesConfig extends ValueSeriesConfig {
@Entity
@Table(name = "Schedule")
public class Schedule implements EventGenerator {
@Entity
@Table(name = "AlarmConfig")
public class AlarmConfig {
  @Id
  long id;
  @ManyToOne
  @JoinColumn(name="TriggerId") /** This is not enough... */
  EventGenerator triggeredBy;
}In this code, the AlarmConfig.triggeredBy field can reference some of the classes in the ValueSeriesConfig hierarchy and the Schedule class, since they implement EventGenerator. Is it possible to use JPA annotations to link this up correctly? Is there something akin to Tuplizers I can insert to decode it?
Thanks in advance,
-Lars Clausen

any idea how to do this in AIR 2?  Looking at the documentation, I see that you can run executable files using the NativeProcess class, so I guess could execute something like "cscript filename.js" and then "filename.js" could contain WScript methods.  But does anyone know of a way I can take advantage of COM interfaces more directly using AIR 2?

Similar Messages

  • Prime infrastructure 2.0 - Inventory error with Virtual-Access Interface

    Hi,
    We have recently been trying to resolve a few issues with routers which get partial inventory failures upon discovery. I have managed to narrow this down slightly with the help of the inventory.log file. (With help from this post https://supportforums.cisco.com/thread/2255346 ) I have found the following happnes when this device is added:
    [2014-03-04 14:00:27,537] [ICE Service[ 1]Thread: 29] [inventory] [ERROR] - 172.16.3.202 Object detected as SAME but DB Object obtained from the database is NULL For instance id: 0 For generated POJO: PPPEncapsulation[callBack=false,callIn=false,callOut=false,multilink=false,name=Virtual-Access1,oneTime=false,owningEntityId=69757688_172.16.3.202,preferedAuthType=NONE,deployPending=NONE,name=Virtual-Access1,owningEntityId=69757688_172.16.3.202,instanceId=0,_orderedListOEIndex=<Integer>,_creationOrderIndex=<Integer>,instanceVersion=0]
    I have highlighted above where it mentions the problem with the virtual access interface. The configuration on the router is for PPPoE and the virtual-access1 interface is bound to Dialer0.
    It then goes on to roll back the transaction:
    172.16.3.202 persistObjects called with addList size = 307, updateList size = 6
    172.16.3.202 Exception while persisting: com.cisco.xmp.persistence.common.util.DMMCRUDException:,message=errorId=12,componentName=CRUD Error Create Object Failed
    172.16.3.202 Exception occured while inventory collection for device with id 69757688: com.cisco.xmp.inventory.ice.InventoryException: errorId=12,componentName=CRUD Error Create Object Failed
    172.16.3.202 Done with collection. Total call method time: 15308
    172.16.3.202 Rolling back the transaction
    Has anyone else come accross this issue?
    I have attched the log showing just messages from this device.
    Thanks,
    Mike.

    TAC and I found a bug, CSCum05301.
    May be that is also helpfull for others.
    https://tools.cisco.com/bugsearch/bug/CSCum05301/
    Symptom:
    Inventory collection will fail if following keywords are used as part on description command on the interface config level of IOS device: 1Gbps, 10Mbps etc.
    Following error message is visible on the DWC:
    Inventory Collection Status: Partial Collection Failure
    Collection Status     Failed feature(s)
    Unable to configure DSL, Serial, POS, Ethernet, Loopback, Virtual-Interface, Tunnel, Vlan, Switchport and Service Module interfaces on ISR, ASR and Switches.
    Conditions:
    Speed keywords like 1Gbps, 10Mbps etc. available as part of descrption command in IOS interface level.
    For example:
    interface FastEthernet0/3
    description 10Mbps
    Workaround:
    Use a space character between number and unit keyword, like 1 Gbps.

  • How to persist interface in JPA?

    Hello guys,
    I am having a class which has a Interface reference as a attribute.
    If i want to persist my class how i can do that???
    class MyNode {
    //Ref of interface
    private MyInterface inter;
    If it is not possible then what it's workaround?? Because interface usage is essential. RIGHT???
    Regards,
    Nachiket

    You'll need to define the classes implementing the interface as JPA entities, and provide a @OneToOne mapping.
    Of course you'll need to design the mapping in such a way that you can get disparate objects to map correctly.
    Most likely that means you'll have to map from the contained entity to the containing entity.

  • SAP CRM to MS Access Interface

    I have a CRM to MS Access Interface that I have to set up. Has anyone set that up before and if so;
    How was it done?
    Any documentation on that?

    Dear Abdul!
    There are probably many ways to achieve what you´re looking for. It heavily depends on several factors, which solution turns out to be the best for you. You should take into account security, data integrity and sensitivty, business context and system architecture, among others.
    First of all though, you should specify wheter you want to access the SAP table for unidirectional read access only, or if you have the requirement to also update data in any SAP table (are you talking about a SAP standard table or a customer Z-table?)
    If you´re looking for a straight forward solution for read-only access, you can create a custom Z* RFC-enabled function module that reads out your SAP table and returns the values to your calling application. You could also use the WebServices interfaces of your SAP WebApplicationServer, depending on your release level. Furthermore, kindly check, if there are standard BAPI´s available that contain the data you need in their return parameters.
    Of course, you also could directly interface on a DBMS level between MS access and your underlying SAP DB, but most likely such a solution will never be supported in any productive environment, and for good reason. So you should look into one of the other options mentioned.
    I´ll gladly provide more detail about any of the mentioned approaches, but would like to have a little more input about your requirements before, so the optimal solutions can be found.
    Kind regards
    Christoph

  • PPP IP address and virtual-access interface

    With what command can I find out what IP address has been bound to which virtual-access interface of a PPP negotiated connection to an IOS router 2811/12.4(17a)?
    Thanks for any hint.
    Mat

    Hi Mat,
    try the command "sh us a" (I think the long version is show users all).
    HTH, regards
    Mark

  • Access interface related entries from within Receiver Communication Channel

    Hi,
    when i open the interface determintation that i created, i can see.
    Sender Details:
    Communication Component:Sys_Sample_One_D
    Interface: UserMasterQuery_Outb
    Namespace: urn:sample.com:I_Legacy_JDBC_Application
    Receiver Details:
    Communication Component:Sys_Sample_Two_D
    Interface:EmployeeEmailProcessing_Inb
    Namespace:urn:sample.com:I_Legacy_FileApplication
    Interface Mapping: UserMasterResultset_to_EmployeeEmail
    I created a Generic File Receiver communication Channel for my receiver BS: CC_FileReceiver
    In the target FileName field of the Communication channel, i would not like to hardcode any filename value, but my requirement is, the filename should be the same as the name of the Receiver Interface, that has been used in the message exchange.
    in my case, it should be something like EmployeeEmailProcessing_Inb.xml
    How can we access dynamically the interface related entries in the Communication channel, and how can we set those values in the Target Filename value of the File Receiver communication channel.
    in short, if i use the same communication channel for other scenario, the received filename should be different based on the receiver interface name that is executed.
    It would be even more better if i could access/set the receiver namespace value as part of the TargetFileName or TargetFileDirectory values.
    pls let me know how this can be possible.
    Thanks in advance,
    Madhu

    Hi Shabarish,
    thanks for your blog.
    After i saw the blog, the UDF can be created in ESR.
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create(u201Chttp://sap.com/xi/XI/System/Fileu201D,u201CFileNameu201D);
    String MyFileName = a + "_" + b +".xml";
    conf.put(key, myFileName);
    At this point, i can see that the required value is stored in certain key in the DynamicConfiguration.
    In the blog, i could not see anything related to ID.
    My question is, what do we need to do ID,
    when we create the FileReceiver Communication Channel, in that we need to specify the mandatory field "Source File Name". what value do we need to enter here.
    Are there any additional things do we need to do in Communication Channel in ID.

  • Concurrent access issue with JPA  for a Select query?

    Hi All,
    I have been trying to understand why this code,
    public <T> List<T> findManyNativeSql(String queryString, Class<T> resultClass)
                Query aQuery = getEntityManager().createNativeQuery(queryString,resultClass); // Throwing the following exceptionis causing this exception.
    <openjpa-1.1.0-r422266:657916 fatal general error> org.apache.openjpa.persistence.PersistenceException: Multiple concurrent th
    reads attempted to access a single broker. By default brokers are not thread safe; if you require and/or intend a broker to be
    accessed by more than one thread, set the openjpa.Multithreaded property to true to override the default behavior.
            at org.apache.openjpa.kernel.BrokerImpl.endOperation(BrokerImpl.java:1789)
            at org.apache.openjpa.kernel.BrokerImpl.isActive(BrokerImpl.java:1737)
            at org.apache.openjpa.kernel.DelegatingBroker.isActive(DelegatingBroker.java:428)
            at org.apache.openjpa.persistence.EntityManagerImpl.isActive(EntityManagerImpl.java:606)
            at org.apache.openjpa.persistence.PersistenceExceptions$2.translate(PersistenceExceptions.java:66)
            at org.apache.openjpa.kernel.DelegatingBroker.translate(DelegatingBroker.java:102)
            at org.apache.openjpa.kernel.DelegatingBroker.newQuery(DelegatingBroker.java:1227)I have tried looking at the query which gets printed in the logs when the exception is thrown
    [[ACTIVE] ExecuteThread: '32' for queue: 'weblogic.kernel.Default (self-tuning)'] ERROR jpa
    - ID: 133  queryString= select * from Details where cust_name='SETH'Any suggestions on the following would be very helpful
    Also, AppServer: WL10.3 is being used.
    VR

    I'm not sure what a Broker is in OpenJPA so you may want to post in an OpenJPA forum. I would suspect though that a broker is underneath the EntityManager, and it might suggest that this EntityManager instance is being shared among threads. Verify that the EntityManager returned is not being used in multiple threads; if it is used in multiple threads concurrently, this needs to be changed to obtian a new one and release it when done as they are not thread safe. You might also try using EclipseLink as the JPA provider to see if you get a different error message that might point out the problem.
    Best Regards,
    Chris

  • Accessing interface components from a seperate class

    Hi there,
    I've just been given a Java project to build, that involves writing an applet to allow text based communication between pairs of people. I've always thought the best way to go about it was to divide code into functional units, i.e. put the user interface code in one class and the code that responds to user interface interactions in other classes (of the same package).
    The problem is getting the other classes to access the interface components created in the interface class.
    So for brevity, here is my interface Applet class;
    package name;
    import statements here;
    public class Communicate extends Applet {
    declare all variables, strings, labels, combo boxes etc
    //Construct the applet
    public Communicate() {
    try {
    jbInit();
    } catch (Exception ex) {
    ex.printStackTrace();
    //Initialize the applet
    public void init() {
    try {
    jbInit();
    } catch (Exception e) {
    e.printStackTrace();
    private void jbInit() throws Exception {
    add components here
    //Now the problem. In the interface there are combo boxes. When the user clicks a button it constructs a jframe that asks the user for a string. The idea is that the string be added to a combobox using add item. If I leave this code in the applet class it works fine, e.g.
    public void jButton5_actionPerformed(ActionEvent actionEvent) {
    JFrame f = new JFrame();
    f.setSize(200, 200);
    f.setLocation(200, 200);
    f.setVisible(false);
    //Add those boxes to the JFrame
    JTextField titleField = new JTextField();
    String title = "Please enter the title";
    int result = JOptionPane.showOptionDialog(f,
    new Object[] { message },
    "New title", JOptionPane.OK_CANCEL_OPTION,
    JOptionPane.QUESTION_MESSAGE,
    null, null, null);
    String title = titleField.getText();
    jComboBox2.addItem(title);
    //as jComboBox2 is decalred in the applet above, it adds the string no problem.
    But what I'd like is the following, a title class on its own to make it easier to update and modify,
    e.g.
    public void jButton5_actionPerformed(ActionEvent actionEvent) {
    try {
    Title title = new Title();
    catch (Exception ex) {
    ex.printStackTrace();
    with the Title class written as such:
    package name;
    import statements;
    class Title {
    Title() {
    //Set the new title
    JFrame f = new JFrame();
    f.setSize(200, 200);
    f.setLocation(200, 200);
    f.setVisible(false);
    //Add those boxes to the JFrame
    JTextField titleField = new JTextField();
    String title = "Please enter the title";
    int result = JOptionPane.showOptionDialog(f,
    new Object[] { message },
    "New title", JOptionPane.OK_CANCEL_OPTION,
    JOptionPane.QUESTION_MESSAGE,
    null, null, null);
    String title = titleField.getText();
    *** Here is the problem: How do I reference jComboBox2 which is declared in the original applet class?
    jComboBox2.addItem(title); (this wont work!)
    public static void main(String[] args) {
    Title title = new Title();
    I'd thought perhaps I needed to create an instance of the applet and pass it to the second class to use it, so it can reference the components, but I'm not sure how to do this with an applet.
    Thanks
    Maria

    I'm not going to look at your unformatted code, but I'll give you some general hints:
    Have one set of classes being the GUI
    Have one set of classes being the data (the chat history, basically)
    Have one set of classes being the logic
    Have one interface for the logic to manipulate the data (e.g. addNewMessage(String)
    Have one interface for the GUI to get the data that's to be displayed (e.g. getLastTenMessages())
    Have one interface for the logic to notify the GUI of changed data (refresh())
    Have one interface for the GUI to notify the logic of user input (e.g. sendMessage(String))
    The logic will receive data either from the user and send it, as well as storing it in your chat log, or it will receive it from the network and add it to the data model, both times notifying the GUI of changes afterwards.

  • Anywhere Access interface best practice

    Hello,
    We are setting up Anywhere Access on Windows 2012 AD/DNS with the following configuration;
    Ethernet 1:
    IP: private
    Subnet: 255.255.255.0
    Gateway: Firewall/Router with private IP address 
    DNS: Ethernet 1 IP address
    Ethernet 2:
    IP: public (remote.domain.com - Anywhere 
    Subnet 255.255.255.248
    Gateway: DSL modem with public IP address
    DNS: Ethernet 1 IP address
    Questions:
    1. Considering only one gateway can be defined for multiple interfaces, from the best practices point of view please advise which one should be the gateway out of two underlined gateways:
    Firewall/Router with private IP address or
    DSL modem with public IP address
    2. Considering Ethernet 2 is configured with public IP addresses, please also advise if DNS for Ethernet 2 is correct or it should be public DNS. 
    Thanks.

    Generally the private interface. This one may help.
    Configuring and Customizing Remote Web Access on Windows
    Server 2012 R2 Essentials
    or try them over here.
    https://social.technet.microsoft.com/Forums/windowsserver/en-US/home?forum=winserveressentials&filter=alltypes%2Cnoreplies&sort=lastpostdesc
    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows]
    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.

  • How to use SNMP to access interface counters for WAN port when not in bridged mode

    Hi All,
    Can't fault my timecapsule, however just struggling to get one little bit of functionality working.  I'm keen to get access to the WAN port interface counter information via SNMP, so I can track total bandwidth/throughput & also volume. 
    I have no issue getting SNMP to work & can see the 2.4 & 5.0GHz network counters, also total number of WIFI clients, wlan0, wlan1 and bridge0 interfaces.  Trouble is none of these are the WAN/external ethernet port.
    I see that it is likely that I'm trying to find the vlan1 port, however from what I'm reading this may only be available when the device is running in a routed mode (I'm running in bridge mode).
    Anyone able to suggest anything?

    Some cable modem you can turn off NAT.. and then use the TC in router mode.. or even use DMZ if the cable router allows that.
    Have you ever looked at gargoyle router firmware and its ability to count and quota all clients connecting to internet service.. it is a simply fantastic firmware and can be loaded onto a router that costs $70-130 dollars.. it is 3rd party but very solid if you choose the right combo.
    http://www.gargoyle-router.com/wiki/doku.php?id=screenshots

  • Accessing interface controller in different WD DC

    Hi,
    I have the following question related to using coding from WD DC1 in DC2 (just two example DCs) since I have problems accessing the interface controller of a different WD DC.
    What steps are necessary to use the interface controller of DC1 (to be more precise the interface controller of a particular WD component within a WD DC) in DC2 and even more important in which order?
    My assumption:
    1) Expose interface controller as public part of DC1.
    How is this done? Via exposing the whole WD Component in the public part wizard?
    2) Build DC1.
    3) Add DC1 to "Used DCs" for DC2.
    4) Now the DC1's interface controller should be accessible? Am I right?
    Unfortunately is the corresponding interface controller not visible in DC2.
    Any help is really appreciated.
    Kind regards,
    Michel

    Hi Michael,
    After adding the first DC's component to DC2's used DC's, did you select the same under the used WebDynpro Components of the component controller? If not :
    Under the component controller of your second DC, right click on "used WebDynpro Components", select "Add Used Component" and then on clicking on the browse button, in addition to the same component controller you will be able to see the component of the first DC too. Select this and provide a suitable name.
    After this you will be able to access your first DC's interface controller in DC2.
    Hope this helps,
    Best Regards,
    Nibu.

  • Accessing Interface

    How can I access my routers interface via wireless? Tried to access it via 192.168.1.1 and it gives me "Cannot use wireless interface to access web."
    Note**** I have no ethernet cable with this laptop and I have no way to connect hardwired to the router. No other computer available. 
    Is this even possible?

    jobdude wrote:
    I had the same problem for a week. Contacted support and was told that a factory reset was the only option. It fixed it for sure.. but it is the 5th time in 3 months that I had to reset.
    What is the model of your router? When you tried to log into the router page, did you get any error message? Was the internet still working even though you cannot access the router interface? Are there any connection issues with the network? If there are, then make sure that your firmware is up to date. For more information you may also check the links below:
    Title: How to access the router’s web-based setup page
    Article ID: 3676
    Title: Encountering difficulties accessing the router's web-based setup page
    Article ID: 3956

  • WRT54G: Browser access interface corruption?

    WRT54G V.5:  Completed firmware upgrade to v1.02 successfully...but...now when accessing administration interface through browser the interface seems corrupted.  There are no Tabs, etc. only some random block graphics, a few populated data fields and so forth.  Any idea on how to correct the corruption or the web page read error?

    Which browser?
    I used both IE7 and Seamonkey.
    Did you enable JavaScript (not Java)?
    Yes, I enabled Javascript in both browsers on both pcs.
    In IE enable the scripterror display in the advanced internet options. For Firefox check the javascript error console for errors.
    Since when did you have the problem? Did you try a firmware reflash to fix it?
    I have not had any reason to try to access the configuration utility for a few months as everything was working fine but all of a sudden, my win98 machine lost internet. I've tried everything within windows to get the internet to work with no luck. I thought I would check the settings in the router to make sure all is well there, but, like I said, I can't use it because of the web display corruption.
    Did you reset the router?
    Yes, I have done a reset and have even set the router back to factory defaults via the button on the back and am in the process of setting the router back up. Still have the same problem if I try the web based config though.
    I have another problem now, since I reset the router back to factory defaults, I am running the setup wizard from the disk, but it keeps asking me for a password. As I have reset the router, I assume the password is admin but that doesn't work, just hitting enter doesn't work and my old password that I had changed it too previously doesn't work.

  • JCom/Jacob for MS Access interface

    Has anyone used JCom or Jacob to interface with MS Access. I have to open the access database, import a few xml files and close the database. I have seen examples with MS Excel but none with Access. Any help would be appreciated.
    Thanks.

    Am not sure how I can use JDBC instead. I dont want
    to setup anything on a specific machine (which I
    think is the case for JDBC). Not sure what you mean. You are going to be doing something on a specific machine. The database has to exist on a specific machine. That is true regardless of how you touch it.
    My idea was that if I use JCom or Jacob I can
    interface with any MS application if it is installed
    on the machine and perform operations.
    Could be. Is your goal to do something with many different applications or to do something with MS Access?
    What I am trying to do is import some xml tables into
    MS Access. Is there an easy way to do it using JDBC?JDBC lets you put data into MS Access. Perhaps the other tools do not require you to do anything with the XML directly. JDBC would. But other than that the source doesn't matter.

  • To access interface attributes at runtime

    Hi,
    My program contains a interface i1 in system sys1 & interface i2 in system sys2. I have to write a function in sys1 to get the attributes of either i1 or i2 based on the system , with out compilation error.
    ie) if system is sys1.
    x = i1=>attribute.
    else if system is sys2.
    x = i2=>attribute.
    endif.
    kindly help me to solve this issue with out getting compilation error.
    Thanks,
    Jey

    Hi Jey,
                 You can use the USING and CHANGING to get the value without compilation error.
    Regards,
    Sayak...

Maybe you are looking for