Some important question about JPA!!!

Hi there, I have a web application written in Java 1.4
I want to move this to Java 1.5 using JPA but after review old code I've got some stuck:
1. This application have a function that get Lists from a table:
Collection getList(String className, string tableName)
That do follwing tasks:
Get set of properties from class schema (by className)
Get record set from table
Each row of record set do:
- Create object and set properties value from column that named the same name of property.
- Add object to collection
Return collection
As my knowledge, in JPA, each entity class schema is mapped with a table schema. So, this function can't migrate. But in my application case, there are about 50 tables, mapping entities to each table is not good idea. Is there another solution?
2. In database design, a table have composite PKs that merge from many part, each part is a property of entity too, for example table User have column User_ID = Agency_ID + Deparment_ID + SeqNum. How I can map Agency and Department properties of User entity to the table User?
Please help me, thanks
Thank you.

Hi uvnet,
I think the old code can run in java 1.5 with a minor change but the problem is I want take advantage of using 1.5 especially JPA (big change :D ).
Anyway, the sample code would be:
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.beanutils.PropertyUtils;
public class DAO {
     public Collection getList(String className, String tableName, int encoding) {
          Object objDescriber = null;          
          ResultSet rs = null;
          Map map = null;
          Iterator properties = null;
          ArrayList<Object> returnValue = new ArrayList<Object>();
          try {
               objDescriber = (Object)Class.forName(className).newInstance();
               try {
                    map = BeanUtils.describe(objDescriber);
                    properties = map.keySet().iterator();
                    //Get ResultSet from Table
                    rs = getResultSet(tableName);
                    while (rs.next()) {
                         while (properties.hasNext()) {
                              String name = (String) properties.next();
                              String typeName = PropertyUtils.getPropertyType(objDescriber, name).getName();
                              //Get value from current row and column name of ResultSet
                              Object value = getValue(rs, name, encoding);
                              try {
                                   Object obj = (Object)Class.forName(className).newInstance();
                                   PropertyUtils.setProperty(obj, typeName, value);
                                   returnValue.add(obj);
                              catch (Exception ex) {
               catch (Exception ex) {
          catch (Exception ex) {
          return returnValue;
}

Similar Messages

  • I have a Macbook Pro june 2011... I have 8GB ram but I only have 256mb VRAM... I've read some other questions about this and I realized... Why do I not have 560mb of VRAM since I have 8GB of RAM? Is there any way to get more VRAM to play games on steam?

    I have a Macbook Pro june 2011... I have 8GB ram but I only have 256mb VRAM...
    I've read some other questions about this and I realized... Why do I not have 560mb of VRAM since I have 8GB of RAM?
    Is there any way to get more VRAM to play games on steam?
    I've learned  by reading other topics that I can't upgrade my graphics card on my Macbook Pro because it's soldered into the motherboard or somthing like that, but please tell me if there is any way to get more video ram by chaning some setting or upgrading something else. I'd also like to know why I only have 256MB of VRAM when I have 8GB of RAM, since I have 8GB of RAM I thought I was supposed to have 560mb of VRAM...
    So the two questions are...
    Is there any way to upgrade my VRAM, so that I can play games on steam?
    Why do I only have 256MB VRAM when I have 8GB total RAM?
    Other Info:
    I have a quad core i7 Processor.
    My graphcics card is the AMD Radeon HD 6490M.
    I am also trying to play games on my BOOTCAMPed side of my mac, or my Windows 7 Professional side.
    THANK YOU SO MUCH IF YOU CAN REPLY,
    Dylan

    The only two items that a user can change on a MBP are the RAM and HDD (Retinas not included).  You have what the unit came with and the only way you will be able to change that is to purchase a MBP with superior graphics
    If you are very much into gaming, the I suggest A PC.  They are far superior for that type of application to a MBP.
    Ciao.

  • Some generic  questions about JMF

    Hi, as new to JMF, I would like to ask some generic questions about JMF from this community
    Though including RTP stack, JMF is only compatible to old RTP draft, RFC1889. I know that Sun stopped developing/supporting JMF. What is the alternative solution for JAVA RTP implementation suitable for a serious SERVER project, not just a school-term project? Has anyone thought about that or may have already moved forward? Is that any commercial or more updated Java based RTP stack currently? I searched with google. Besides jrtp, a school project, and I could not find a nice one. Majority of RTPstack implementation is C/C++.
    My second question is if there is the performance analysis and comparison of JMF. I know that some client applications such as SIP-Communicator adopt JMF for media delivery. But it is for one user in one machine. I wonder if any server application has adopt JMF as media relaying layer.
    I appreciate any input from this community.

    erwin2009 wrote:
    Hi, as new to JMF, I would like to ask some generic questions about JMF from this communitySure/
    Though including RTP stack, JMF is only compatible to old RTP draft, RFC1889. I know that Sun stopped developing/supporting JMF. What is the alternative solution for JAVA RTP implementation suitable for a serious SERVER project, not just a school-term project? Has anyone thought about that or may have already moved forward? Is that any commercial or more updated Java based RTP stack currently? I searched with google. Besides jrtp, a school project, and I could not find a nice one. Majority of RTPstack implementation is C/C++. There is one active project out there, Freedom for Media in Java, that has RTP capabilities. It's obviously not from Sun, but it's the only other RTP-capable project I am aware of, other than FOBS4Java, I believe is the name of it.
    What they are suitable for is beyond my scope of knowledge, I only know of the 2 projects.
    My second question is if there is the performance analysis and comparison of JMF. I know that some client applications such as SIP-Communicator adopt JMF for media delivery. But it is for one user in one machine. I wonder if any server application has adopt JMF as media relaying layer. None that I have seen, except for various projects I've helped people with on this forum. But, if someone is asking for help on a forum with his/her server application, it probably doesn't meet the guidelines you just laid out ;-)
    I appreciate any input from this community.Sorry I don't have more to add to your inquires...

  • 3 important questions about SAP HANA

    Hello Community!
    I have got 3 important questions about SAP HANA.
    1.
    - Our Company has all up about 150 SAP - Systems.
    - 12 Systems are ERP-Systems.
    => We consider about SAP HANA at the moment.
    => Is it possible to put all the 12 ERP-Systems in ONE SAP HANA or do I need one seperate HANA for each ERP-System?
    => If it is possible, can you tell me the disadvantages when I use 1 HANA for the 12 ERP-Systems.
    => Is there a Storage-Limit in the HANA (I think no, because of 64 bit).
    => Can I still make realtime-analytics with 1 HANA for 12 SAP Systems?
    2.
    => Can I run ONE HANA with different non-SAP-Systems?
    3.
    => Is there a Demo-Center from SAP or IBM, where I can test and see the HANA before I buy it?
         (I do not mean the Fujitsu TDS Demo Center)
    It would be nice, when you would answer all my questions.
    Thank you.

    I have got 3 important questions about SAP HANA.
    1.
    - Our Company has all up about 150 SAP - Systems.
    - 12 Systems are ERP-Systems.
    => We consider about SAP HANA at the moment.
    => Is it possible to put all the 12 ERP-Systems in ONE SAP HANA or do I need one seperate HANA for each ERP-System? Yes it is quite possible to put all the ERP/CRM/SCM or other components on one HANA. You need to check for pricing/users/RAM (storage)
    => If it is possible, can you tell me the disadvantages when I use 1 HANA for the 12 ERP-Systems.
    There are no disadvantages as of now.. improve existing planning, forecasting, pricing
    optimization and other processes
    => Is there a Storage-Limit in the HANA (I think no, because of 64 bit).
    There is no limit on Stotrage: You need check how much Data you need on RAM (Real time processing) Storage.Minimum you can buy is 64 GB and multiple of it for (RAM)
    => Can I still make realtime-analytics with 1 HANA for 12 SAP Systems?
    Yes certainly..
    2.
    => Can I run ONE HANA with different non-SAP-Systems?
    YEs you can run HANA for 3rd party S/W or non-sap systems for your real time anlytics.
    It has ODBC and JDBC both and you can combine it with other systems.
    3.
    => Is there a Demo-Center from SAP or IBM, where I can test and see the HANA before I buy it?
    (I do not mean the Fujitsu TDS Demo Center)
    This you need to check with your local SAP Service channel..
    It would be nice, when you would answer all my questions.
    Thank you.
    PY

  • Some basic question about SCM Installation

    Hi Folks,
    Could you please advice me about some basic questions about SCM and its installation -
    Q1. Do I need to have an R/3 System to be able to practice OR demo the SCM system?
    Q2. If, yes, which version of SCM is compatible with the ECC 5.0?
    Q3. What are the basic requirements to install SCM (version compatible with ECC 5.0) and ECC on a oracle db and windows OS?
    Q4. Does SCM have APO and BI as an inbuilt functionality OR does the user need to purchase these as an Add-On?
    I know these are some basic questions, but these will help me give me a direction.
    With best wishes,
    Krishna

    Hello Krishna -
    Q1. Do I need to have an R/3 System to be able to practice OR demo the SCM system?
    ---> There are various Modules in SCM Like APO (Sub Modules  DP (stand alone), SNP Needs Master data from R/3 and has to pass on transactional Data to R/3, PPDS same as SNP, GATP same as SNP), ICH needs Data from R/3 to work with. Core Interface (CIF) connects R/3 to APO for transferring data.
    Q2. If, yes, which version of SCM is compatible with the ECC 5.0?
    -->For thorough understanding explore the following links
    http://help.sap.com/saphelp_scm41/helpdata/en/9b/954d3baf755b67e10000000a114084/frameset.htm
    http://help.sap.com/saphelp_scm50/helpdata/en/9b/954d3baf755b67e10000000a114084/frameset.htm
    Q3. What are the basic requirements to install SCM (version compatible with ECC 5.0) and ECC on a oracle db and windows OS?
    -->Refer Above
    Q4. Does SCM have APO and BI as an inbuilt functionality OR does the user need to purchase these as an Add-On?
    --> APO comes with a small BI inbuilt functionality. you can only perform certain functions using that BI.
    Hope this helps.
    Regards,
    Suresh Garg

  • Some basic questions about DAC

    Hello
    I am just starting to use DAC now and I have some basic questions about DAC..
    1: How many different kinda image tables are there, what are they used for?
    2: In order to check which ETL mapping with in the same execution plan is taking a long time, what to do? I mean is there a table that stores such info?
    3: How to determine which ETL task to run after and which after?
    4: Is subject area always map to the Informatica workflow folder? Or what should subject area be?
    Please shed some lights on it, deeply appreciate!
    Thanks

    Hi,
    I have problems to understand you question but will do a try:
    From a logical point of view objects can be only serialized reasonabely when they have a state of it's own which can be reestablished at a later point in time and space without further dependencies.
    F.E. a "serialized file" would NOT make much sense cause it depends heavily on the state of the underlying file system.
    You can't expected that is can be deserialized at a later point of time (physical file refered may not longer exists) or on another machine, where the serialized object was transported to.
    Technical - at zero approach - it's more or less trivial. Simply implement Serializable and all non static, non transient fields of your object will be serialized automatically.
    But there is a couple of pitfalls, you should study documentations regarding this feature.
    Hope this helps
    Martin

  • Some random questions about integration features

    Greetings,
    after working for a few weeks with Autovue's ISDK (web server) and having some sucess with its integration with our custom CMS, I have a few random questions about what can be done and what can't be done. So, instead of opening many new threads, I'll post them here together.
    1) Translation. We are localised in Russia, and its translation is incomplete. I have found a tra_en.properties file in AutoVue/bin, and a description about how to create a properties file for custom actions. But no information about how to translate to other languages - and russian translation appears to be packed within the jar of the applet. Is there a clean way to translate, or refine the current translation, so we don't get a mix of russian and english commands in the applet? Because my tries using EXTRABUNDLES have failed, as I don't want to add a bundle for extra actions, but to replace it for existing ones.
    2) Attachments in markups. Markups allow to attach other files, but since our CMS is custom, we only get the option to attach files from our local drives. We did no browse integration with the CMS, as people with different levels of permission will have different access to files there, and we considered unnecessary to provide that level of integration. We are considering to remove this action from the GUI, but before that I'd like to evaluate how hard would it be to generate an upload file action, so the attached file would be stored in the custom CMS and linked to it so the whole thing worked. My guess is "it will be hard and time consuming", so for now, we are considering to delete this feature in our integration.
    3) Is there a way to resize the Open markup dialog? We have several properties displayed, and fit well within a standard screen, but the dialog is small and you have to scroll the table to see all properties.
    Thanks for any assistance with these issues

    As always, thanks for the fast answer, Artash.
    Yes, now I see attachments are stored inside the markup file. The problem is, when I open markup mode for the attachment, since the attachment uses some kind of default access method, my url's from the integration with the background CMS are broken completely. I believe the ideal state here would be to make some kind of inner markup for the attachment, maybe stored within the original markup file along the attached file. Or maybe it works that way, and I need to access it with the default gui action instead of my custom one. If that is the case, is there any way to tell the gui file how to differentiate a standard opened file from an attached one? If so, the issue has solution. If not... Well, then maybe something escapes me.
    Edited by: Jordi Bosch on Apr 6, 2012 12:27 AM

  • Some basic questions about rmi registry  context  "bind" and "lookup"

    We have more processing to do than can be accomplished with a single computer. To solve the problem I've implemented a distributed computing solution using RMI. (The first time I saw RMI was about 2 weeks ago, so please bear with me!)
    The implementation is a proof of concept not a fully fleshed out system. I have one "Workunit Distributor" computer and any number of "Data Processor" computers all on the same lan segment. "Workunit Distributor" and "Data Processor" computers are both RMI client and server to each other. The "Data Processor" computers are given the ip address and name of the "Data Distributor" on the commandline when they start. They communicate their willingness to receive and process a workunit to the ""Workunit Distributor" via a RMI call. Work units are sent to available "DataProcessors" and results are eventually returned to the "WorkunitDistributor" (minutes or hours later). The model program works quite well, and appears to be capable of doing the processing we need to get done.
    But now that it seems viable, I've been asked to make it a little more scalable, flexible and self configuring. In particular, instead of one "Workunit Distributor", any number of "Workunit Distributors" should be allowed to show up or disappear from the lan at any time and the system should continue to function. I've worked out a good scheme for how this can be done, but I have a couple of questions about the RMI registry (registries?). I'm trying to keep from implementing some functionality that may already be available as a library or subsystem.
    With my current model design, each computer binds to its own registry with a unique name. For instance:
    CRDataProcessorImpl crdpi = new CRDataProcessorImpl(svr);
    Context crDataProcessingContext = new InitialContext();
    crDataProcessingContext.bind("rmi:"+hostName, crdpi);
    Currently the "Data Processors" get the info they need for a Context lookup() of the one and only "Workunit Distributor" from the commandline. And the info the "Workunit Distributor" needs to do a Context lookup() of a "DataProcessor" is passed to it from each "DataProcessor" via a RMI call.
    But in the newer (yet to be implemented) scheme where any and all "Workunit Distributors" show up and disappear whenever they feel like, the naming bootstrapping scheme described above won't work.
    I can imagine a few ways of solving this problem. For instance, having "Workunit Distributors" multicast their contact information on the lan and have a worker thread on each "Data Processor" keep track of the naming information that was multicast. Another alternative (more organized, but more complex) might be to have a dedicated host with a "well known" address and port that "Workunit Distributors" and "Data Processors" could all go to, to register or look up at an application level. Sort of a "domain name service" for RMI. But both these schemes look like a lot of work to implement , debug and maintain.
    The BEST thing would be if there was one plain vanilla RMI registry that was usable by all RMI enabled computers instead of having each computer have its own local name registry. In volume 2 of the Core Java2 book it says that every registry must be local. I'm only hoping there's been progress since the book was published and now a central rmi registry is available.
    If you have any ideas about this I'd like to hear what you know.
    Thanks in advance for any advice.
    Lenny Wintfeld
    ps - I don't believe web services, as full featured as it is, is a useful alternative. I'm moving 100's (in the future possibly 1000's) of megabytes back an forth for processing.

    The local bind/rebind/unbind restriction is still there and it will always be there.
    I would look at
    (a) RMI/IIOP, where you use COSNaming as a registry, which doesn't have that registriction, and which also has location-independent object identifiers
    (b) Jini.

  • Some basic questions about serialization

    Hi,
    I have some basic questions on serialization.
    1. What are the basic criteria to make an object serializable(except that it must implement serializable ?) I mean that objects of some class inherently cannot be serialized so any object must have some features which makes it serializable/non serializable.
    2. I know it makes no sense to serialize a socket because it is fixed only by specifying ip and port at both ends, and is valid only when the network connection remains valid. Still in the context of my previous question, I would like to know why a socket cannot be serialized.

    Hi,
    I have problems to understand you question but will do a try:
    From a logical point of view objects can be only serialized reasonabely when they have a state of it's own which can be reestablished at a later point in time and space without further dependencies.
    F.E. a "serialized file" would NOT make much sense cause it depends heavily on the state of the underlying file system.
    You can't expected that is can be deserialized at a later point of time (physical file refered may not longer exists) or on another machine, where the serialized object was transported to.
    Technical - at zero approach - it's more or less trivial. Simply implement Serializable and all non static, non transient fields of your object will be serialized automatically.
    But there is a couple of pitfalls, you should study documentations regarding this feature.
    Hope this helps
    Martin

  • Some important questions on MDM functionality

    Hello All,
    I have some basic/imp questions to be understood on MDM 7.1 for a data consolidation project.
    1) When importing records in import manager, some of the records are failed with this error message "Import failed. Unable to find value map index". When checked the records in excel source, those records are having one or two fields carrying some square like char, ? and some non readable char (chinese, japanese). SAP is the source and SAP CRM has those characters successfully maintained in the system but MDM has some issue. How do we tackle these in MDM to successfully import those records?
    2) How do we archive a repository to create a new one which needs to have empty records in main table but need to carry look up table records?
    3) There are some records attached to workflow and when deleted those records from data manager, system throwing error "attached to workflow". Can anyone help me how to remove this attachment and delete those records?
    4)  The max number of records which can be imported at one shot in import manager is 100K? What happens when we exceed this records let's say 200K? Does the process go infinite loop? Is there a way out to import more than 100K records at one shot?
    5) What are the different types of data consolidation projects MDM Gurus encounter? Elaborate please.
    6) How many clients use Hierarchy, taxonomy, family tables for repository design? Is it very common or rare? And what would be some of the reference  use cases (articles) I could find in sdn blogs for these?
    Thx and appreciate for responding to these and also please let me know if any additional articles around MDM which are very popular and must see for a MDM consultant.
    -Mike

    1) When importing records in import manager, some of the records are failed with this error message "Import failed. Unable to find value map index". When checked the records in excel source, those records are having one or two fields carrying some square like char, ? and some non readable char (chinese, japanese). SAP is the source and SAP CRM has those characters successfully maintained in the system but MDM has some issue. How do we tackle these in MDM to successfully import those records?
    Thats a known issue in MDM 5.5 but i am not sure about the current 7.1 SP08 release it might by fixed too, MDM Import manager does not support some special characters,only solution is to identify those records which has special characters in excel and exclude them from the load, may by unmapping the field which has special characters and load the other fields data using the map. and then login to Data manager and copy the text to the corresponding record  manually.
    2) How do we archive a repository to create a new one which needs to have empty records in main table but need to carry look up table records?
    We can not create a repository from an archive with out main table data automatically. you need to clean the main table manually or by using an import map we can delete the data.
    Check the below link for deleting data from a main table through import manager:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d0245870-0adf-2b10-46a8-ca9dcf8e1a4d?QuickLink=index&overridelayout=true
    3) There are some records attached to workflow and when deleted those records from data manager, system throwing error "attached to workflow". Can anyone help me how to remove this attachment and delete those records?
    Click on workflows tab in data manager and you can find in which workflow the record is and check the history by right clicking on the record. if you have rights to stop the workflow do that , or else login with the workflow owner and stop the workflow so that record will come out of the workflow and will be able to be delete that record.
    4) The max number of records which can be imported at one shot in import manager is 100K? What happens when we exceed this records let's say 200K? Does the process go infinite loop? Is there a way out to import more than 100K records at one shot?
    Importing 100K data in one shot is not a good idea, and the system will go in infinte loop. you need to split the source files in to multiple chunks. chunk size in your system will be set in MDS.INI file, talk to your MDM Basis guy he will help you in getting details of those..
    5) What are the different types of data consolidation projects MDM Gurus encounter? Elaborate please.
    Let us know which kind of consolidation project you are working in, Tricks will be based on the particular requirement
    6) How many clients use Hierarchy, taxonomy, family tables for repository design? Is it very common or rare? And what would be some of the reference use cases (articles) I could find in sdn blogs for these?
    Again for this question it will be based on the requirements... i am sure you will be able to find blogs how to use hierarchies,taxanomies and family tables but not the client names...
    Hope i answered your questions.
    regards
    Sowseel

  • New to Editing and Have Some Important Questions

    Greetings All,
    I would consider myself a new editor - only because I feel I have so much to learn. Currently I edit for a local television show that broadcast on a cable network - I have been using makeshift solutions to get the job done - but would like to move into being a total professional.
    Currently I have - Final Cut Studio 2 (will be upgrading to the new release in approx. 2 weeks) - 8 Core Mac Pro (upgraded video card & and extra ram)
    - 23 inch Display (will purchase an additional 30" HD Display in approx. 2 weeks) -Mac Book Pro
    -Adobe After Effects
    I know that I need some sort of deck that can be used to put the tapes in and log and capture into final cut pro - (currently I rec. the footage on dvd and use MPEG to import the footage into Final Cut) - any recommendations on the type of deck I should get - something affordable that is universal that can be used with many types of tapes. Also I have been told that I may need a broadcast monitor - I've also been told that if I get the 30" HD display that I won't need a broadcast monitor- thoughts on this please? As a side not I have a 32 inch 720p flat screen Samsung television could this be used as a monitor? I've heard some discussion about Konika video capture card - after researching I'm still not sure I understand exactly what it's purpose is? Please help - is this something that I will need? What am I missing in my workflow? Any suggestions or advice would be appreciated - thanks

    only because I feel I have so much to learn<</div>
    Including where to post. This here's the LiveType forum.
    You don't need one deck, you need a deck specific to every kind of tape you have to use. You probably only need a DVCAM deck. If you need Beta you already know that. If you don't know that, you need to start with a basic video production class at a college or high school. That's not a service we provide here in these forums.
    The 30" Apple Cinema is way more screen than you need for FCP. Save your money and just get another 23".
    Konica does not make capture cards. You may be thinking of Kona, easily researched.
    You may or may not need a broadcast monitor. What you need is the firm knowledge and experience to make that decision on your own.
    My suggestion is to look up a video expert in your market area and prepare your management to pay them for their expertise as a consultant. Your post indicates you have way too much to learn. You can do it in books and in many hours of online research but you're going to spend more time and money doing that than you would simply by hiring someone to do the easy parts for you.
    bogiesan

  • Some basic questions about foriegn key , and relationships.

    Hi
    Thank you for reading my post
    I read some documents about foreugn key and tables relation ships.
    but i still can not understnad some stuff.
    1-when we have a foreign key , we have two tables that we want to relate them together
    in a way that one of ? table columns forced to be a value from ?? table column.
    what is name of those two tables , i saw , child-parent , ..... which confuse me.
    can some one please tell me correct name of those two tables ?
    2-some times we need some kind of master details relation like :
    one-to-many : i this case MANY table will have a column to point a record in ONE table , can this relation be a foreign key relation ?
    3-we can achieve many-to-many relation only by using a helper table to host both tables primary keys in a record to relate them together.
    can you point me to some resources that help me to find answers to this questions ?
    or explain them to me ?
    thank you for your time.

    These are critical database basics that you need to understand. I would seriously recommend getting some study in, because proper relational database design relies on the basic principle of data and relationships and a process called normalization.
    In reality, you only really need one gigantic table to host data. It would include everything you would want to know about something - let's take a sales order for example. You would have to record the customer's name, address, etc. along with every item they ordered, etc. You would have a HUGE table full of data that appeared over and over and over again. This is bad design for two basic reasons: it is difficult to query, and it is very easy to have minor mistakes like capitalization or alternate spellings that prevent things from matching up properly. For example, let's say Bob orders 40 widgets and 40 digits. In our hypothetical table, we could put it in as Bob - 40 widgets and Robert - 40 digits. See how confusing this can get even in a simple example? And let's say you wanted to correct all of Robert's orders to say Bob and you found out there were 40 orders from "Robert" How would you know which ones to change?
    The process of normalization helps to reduce the chance for these types of errors in addition to creating a good basis for indexes. You normalize the data by creating sets of parent/child tables with a "key" value to match them. In our hypothetical situation, you could create a table for orders and a table for customers. In the customers table you give all the detail for the customer in one place, and you assign each customer a unique number or ID. In the orders table we add the customer ID (NOT the name) and we ensure that we are getting the customer we want, in addition to saving a lot of space and eliminating redundancy. In our example, the customers table is the "parent" table and the orders table is the "child" table. The child table references the unique entries in the parent table via that id. That reference is referred to as a foreign key. The foreign key in the child table points back to the original and complete record in the parent table and eliminates the redundancy of keeping all that extra data for every order. Foreign keys in child tables always refer to a primary/unique key in the parent field.
    That help?

  • Some basic questions about Java ME

    Hi,
    I am new in the world of Java ME, I started to read about the technologies around it and for this reason I have some questions.
    There are 2 platforms CDC and CLDC and on top of these platforms there are some profiles, for example Personal Profile for CDC or MIDP2 for CLDC. On the next level (on top of these profiles) are some JSRs which are treated as optional packages.
    I saw that the CLDC emulator from SUN - WTK contains for example JSR 179 for Location based services and JSR 226 - SVG rendering. But the counterpart for CDC doesn't contain them.
    How can these JSRs be added to the CDC stack? are there some implementations of these JSRs as jars or something like this? or on the JCP site are only the specifications of this JSRs and if someone wants to add these JSRs to an emulator (virtual machine) he should implement these specifications?
    I hope that I have explained properly my "puzzle" and that someone will answer to my questions.
    Thank you

    1.    String[] numString = {"1","2","345678","9","abc"};
        int[] numInt = new int[numString.length];
        for (int x=0; x<numString.length; x++) {
          try {
         numInt[x] = Integer.parseInt(numString[x]);
          } catch (NumberFormatException nfe) {
         System.out.println(nfe.getMessage());
            numInt[x] = Integer.MIN_VALUE;
        }2. Best for what?

  • Some general questions about swing

    Hi,
    I used to do some swing development couple years back but since then I have been more involved in the j2ee scene. I have lost some touch and was wondering if some of my questions can be answered. I'd appreciate every effort.
    First of all, I am trying to make an applet that can be used to upload multiple pics at the same time. Similar idea to facebook picture upload applet. My Q's are
    -> can every swing application be turned into an applet? or when the developer starts writing an application he should write it from an applet POV
    -> I noticed that the applet on facebook looks a lot like a window application. icons and the look and feel of the application is not that of a applets i saw couple years ago with sun java look and feel, how can this be achieved? is there some small example?
    -> can someone suggest an example || tutorial of an applet that shows how to upload an image to the server?
    and lastly for mental satisfaction :)
    -> how hard do you think it is to build such an application. I assume it will just have a JTree on the left side and on right side it will show contents of the folder that is currently clicked.
    Thanks for your time

    thanks for the tutorial link.
    However, the tutorial explains how to show icons from images. But what about in my case when the images arent even on the server yet.
    Basically when the user is browsing files and gets to their my pics folder on the right side i want to show icons of images in that folder. for this reason i doubt I will be able to use what they've implemented in that tutorial. As the pics havnt yet been uploaded by the user i have no direct access to the images.

  • SOS!! Simple yes/no question about JPA...

    Hello,
    I have the following environment and requirements:
    -Tomcat 5.5 (no ejb container)
    -Latest version of Hibernate
    -JSF 1.1
    -A requirement to use JPA
    -I must use the query cache and the second-level cache
    My question is as follows:
    What is the best solution?
    Solution 1.
    ONE EntityManagerFactory stored in the ServletContext for use by all of my web app users generating MULTIPLE INSTANCES of EntityManagers. (would this allow me to use the query cache?)
    Solution 2.
    ONE EntityManagerFactory and ONE EntityManager stored in the ServletContext for use by all of my web app users.
    Thanks in advance,
    Julien.

    Regarding caching, what exactly are you referring to
    by "query cache"? Are you saying you
    plan to execute the same query multiple times but
    you'd like the underlying persistence manager
    to avoid trips to the actual database? Whether the
    query is executed by an actual database
    access or is fulfilled through some JVM-local cache
    is not controlled by the spec. Most implementations
    do allow for such caching but the behavior is
    persistence-provider specific.Yes. I am actually using hibernate behind the scenes as my persistence framework.
    I'd suggest looking at the presentation from last
    year's JavaOne called "Persistence In the
    Web Tier"
    http://developers.sun.com/learning/javaoneonline/2006/
    webtier/TS-1887.pdfI am going to have a look at that.
    Thanks again.
    Julien.

Maybe you are looking for

  • I am just frustrated

    Upgraded Snow Leopard Server to Lion Server Mailserver VPN Server Opendirectory master Fileserver AFP and SMB --> breaking a lot! 1.) Unable to set up a Opendirectory replica Installed Lion Server from scratch on another system. Any effort to make it

  • Transfer data from iphone 4 to 3g

    I'm transfering data from an iphone4(verizon) to an iphone 3g(tmobile) and only my apps transfered over; non of my contacts or app data. I waited until the transfer was finished.  Is there something I'm missing? Thanks?

  • Comman separated output for a one-many relationship

    I have 2 tables with one2many relation, viz product, subproduct, I wnat to output in the following way i.e product and list of subproducts separated by commas product1- sp1,sp2 product2- sp11,sp12 What would be the best way to handle this ? The produ

  • Access ItemEditor in Datagrid

    Hey I have a DataGrid in which one particular column is editable. The Column looks like this - <mx:DataGridColumn id="AgeCol" headerText="Age" headerWordWrap="true" editable="true" dataField="Age" headerStyleName="headerCustomStyle" >                

  • Premiere pro cs3 window "flickers" or "shakes" then windows shuts down

    lately, i've been having this problem. when i run adobe premiere pro cs3, the window "flickers" or "shakes." i'm not quite sure how to explain it, but it's like a quick "jolt." sometimes it recovers from that and i'm able to continue editing. other t