Update bidirectional ManyToMany relationship

Hello,
we have a bidirectional man-to-many relationship (User - Course).
Now we want users to join courses. How to update the relationship correctly?
If I do
course.getUsers().add(user);
entityManager.merge(course);The user is not updated. Also if a add course to the users course list but only merge the course.
And if I do
course.getUsers().add(user);
user.getCourses().add(course);
entityManager.merge(course);
entityManager.merge(user);I get a duplicate key exception, because jpa tries to add the entry in the join table twice.
How to do this right?
thanks
Dirk

No, they are not managed by the jpa at this moment.
They come from a jsf application, that have serialized the course (into a selectbox).
So simply adding the user to the coures is not enough.
I've tried merging both bevore adding, to get them managed. But this doesn't work too. (The user is in the courses user list, but the course not in the users courses list)
Edited by: Freak.2k on Jun 12, 2009 9:34 AM

Similar Messages

  • Problem with ejb 3.0 entity beans with manyToMany relationship

    Hello everyone!
    I am using struts 1.2.9 and java ee 5 sdk update 2 for my enterprise application. Besides others i have these entity beans Targetgroup.java and City.java, (i would upload file but i do not know how:)
    with manytomany relationship with join table.
    when user updates Targetgroup, by clicking on web page with checkboxes and textfields, struts dispatch action calls following method stateless bean:
    public void update(String firmId, String targetgroupId, String newGender, String newMinYearsOld, String newMaxYearsOld, String[] newCities) {
    TargetgroupPK pkForUpdate = new TargetgroupPK(targetgroupId, firmId);
    Targetgroup targetgroupForUpdate = find(pkForUpdate);
    targetgroupForUpdate.setGender(newGender);
    targetgroupForUpdate.setMinyearold(Integer.parseIn t(newMinYearsOld));
    targetgroupForUpdate.setMaxyearold(Integer.parseIn t(newMaxYearsOld));
    //pronalazenje gradva za koje je vezana ciljna grupa
    Collection<City> newCitiesCollection = new ArrayList<City>();
    for(int i = 0; i < newCities.length; i++){
    String tmp_city_name = newCities;
    City city_obj = cityFacade.find(tmp_city_name);
    newCitiesCollection.add(city_obj);
    targetgroupForUpdate.setCityidCollection(newCities Collection);
    parameter newCities represents names of cities which user checked on his update page. When the page is showen to him some cities are allready check because they were connected with Targetgruoup when it was created (targetgroup).
    this code throws following exception:
    [#|2007-07-26T12:13:36.993+0200|SEVERE|sun-appserver-pe9.0|javax.enterprise.system.container.web|_Threa dID=16;_ThreadName=httpWorkerThread-8080-0;_RequestID=f79d9c50-86b0-4b6c-96ab-97956dfb39c1;|StandardWrapperValve[action]: Servlet.service() for servlet action threw exception
    javax.ejb.EJBException: Transaction aborted; nested exception is: javax.transaction.RollbackException: Transaction marked for rollback.
    javax.transaction.RollbackException: Transaction marked for rollback.
    at
    .com.sun.enterprise.web.connector.grizzly.WorkerTh read.run(WorkerThread.java:75)
    javax.ejb.EJBException: Transaction aborted; nested exception is: javax.transaction.RollbackException: Transaction marked for rollback.
    at com.sun.ejb.containers.BaseContainer.completeNewTx (BaseContainer.java:3659)
    at com.sun.ejb.containers.BaseContainer.postInvokeTx( BaseContainer.java:3431)
    at com.sun.ejb.containers.BaseContainer.postInvoke(Ba seContainer.java:1247)
    at com.sun.ejb.containers.EJBLocalObjectInvocationHan dler.invoke(EJBLocalObjectInvocationHandler.java:1 92)
    at com.sun.ejb.containers.EJBLocalObjectInvocationHan dlerDelegate.invoke(EJBLocalObjectInvocationHandle rDelegate.java:71)
    at $Proxy149.update(Unknown Source)
    at audiotel.sms.actions.backoffice.TargetgroupDispatc hAction.updateOrDelete(TargetgroupDispatchAction.j ava:132)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.struts.actions.DispatchAction.dispatchM ethod(DispatchAction.java:270)
    at org.apache.struts.actions.DispatchAction.execute(D ispatchAction.java:187)
    at org.apache.struts.action.RequestProcessor.processA ctionPerform(RequestProcessor.java:431)
    at org.apache.struts.action.RequestProcessor.process( RequestProcessor.java:236)
    at org.apache.struts.action.ActionServlet.process(Act ionServlet.java:1196)
    at org.apache.struts.action.ActionServlet.doPost(Acti onServlet.java:432)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:727)
    com.sun.enterprise.web.connector.grizzly.WorkerThr ead.run(WorkerThread.java:75)
    |#]
    exceprion is throwen ONLY when in parameter newCities are city names allready connected to Targetgroup. when NewCities contains names of
    City objects which are not connected to Targetgroup it works fine, but it's of no use for me, because user must be able to add or remove certian cities from relaionship with Targetgroup. I think it's because there are rows in join table that contain primary keys of city and targetgroup which are connected so perisistence manager cann't write them again.
    i thought it was going to figure it out by itself, and only update those rows.
    Does anyone know what is the problem and solution?
    Thanks! (forgive my spelling errors :)

    solved the problem!
    I moved code from sesion bean to struts action as follows:
    CityFacadeLocal cityFacade = lookupCityFacade();
    //prikupljanje novih podataka o ciljnoj grupi
    String newGender = ctf.getGender();
    String newMaxYears = ctf.getMaxyears();
    String newMinYears = ctf.getMinyears();
    String[] newSelectedCities = ctf.getSelectedCities();
    //niz imena gradova se prevodi u kolekcju objekata City
    Collection<City> newCitiesObjCollection = new Vector<City>();
    for(int i = 0; i < newSelectedCities.length; i++){
    String tmpCityName = newSelectedCities;
    City tmpCityObj = cityFacade.find(tmpCityName);
    newCitiesObjCollection.add(tmpCityObj);
    //setovanje novih podataka
    targetgroupForUD.setGender(newGender);
    targetgroupForUD.setMinyearold(Integer.parseInt(newMinYears));
    targetgroupForUD.setMaxyearold(Integer.parseInt(newMaxYears));
    targetgroupForUD.setCityidCollection(newCitiesObjCollection);
    //pozivanje update metdoe u session beany
    targetgroupFacade.edit(targetgroupForUD);
    //korisnik se vraca na stranu sa svim postojecim ciljnim grupama
    forward = mapping.findForward("backend.targetgroups");
    and now it works fine. I guess probelm was same transaction scope for Targetgroup and City entities. Now when they are separated it works.
    Thanks!

  • Owner in ManyToMany Relationships

    Hello all,
    I need to create a many to many relation between some roles and some policies.
    I do not want to cascade PERSIST, or REMOVE. So when creating the relation both the Policies and Roles involved are in the database.
    Also the relation are done in a stand alone client, so the objects become dettached.
    So this is the issue:
    In the first case the Role entity is the owner.
    On the client side:
    role.getPolicies().add( policy );
    remoteSessionBean.updateObject( role ); //executes remotely on the server.All is fine. The role/policy association in saved into the database.
    Now if do:
    policy.getRoles().add( role );
    remoteSessionBean.updateObject( policy ); The relation is not created in the database :(.
    If I make the policy object the owner of the manytomany then the two exemple are reversed: it works when updating the relation via policy, but it does not work when updated via role.
    Is there any way to make it work both at the same time. The GUI allows the user to eiter add roles to a policy and then save the policy, or to add policy to a roles and then save the roles.
    Thank you for your time,
    - Ilie

    The Hibernate documentation states that in a bidirectional relationship both entities need to be updated.
    So the code should look somethig like:
    role.getPolicies().add(  policy );
    policy.getRoles().add( role );
    remoteSessionBean.update( role );
    remoteSessionBean.update( policy );Unless anyone has a better idea this is the only way...

  • Problem in JPA ManyToMany relationship.

    Please look at
    [http://forums.sun.com/thread.jspa?threadID=5358105&tstart=30|http://forums.sun.com/thread.jspa?threadID=5358105&tstart=30]
    thanks.

    You could make a class called (for example) DegreeToSpecialization that would link a Degree to a Specialization (also why do you have specialization and specification?) and save those instead of having them separate.
    Also I suspect there's something other faulty with your design too, but I just had lunch so I can't wrap my brain around this just yet. burp

  • Bidirectional many to many relationship ...

    Hello Friends !
    I want to mapp 2 tables in a bidirectional many to many relationship. kindly help me how can i mapp them. Do i need just LIST collection on both sides or there is something more to do.
    in entity class 1
    @ManyToMany
    private List<Entity1> OneList = new ArrayList<Entity1>();
    in Entity class 2
    @ManyToMany
    private List<Entity2> TwoList = new ArrayList<Entity2>();
    Thanks in advance
    Regards,
    Zeeshan

    Zeeshan
         Hi, For a bidirectional @ManyToMany mapping without a @JoinTable specified - you must specify which side is the owning side so that we know who is the owner of the relationship and optionally the fetchType (fetch).
    You may refer to the following tutorial that contains a bidirectional @ManyToMany from an entity to itself in my case (same principle for different entity classes).
         I arbitrarily chose one side (references) to be the owning relationship (specifies the mapping) and the other (peers) to be the inverse side - where the "mappedBy" attribute is specified that targets the owning side.
    You may use any collection for the type depending on your schema - such as whether you allow duplicates etc.. - I return a Set<Cell> collection.
    http://wiki.eclipse.org/EclipseLink/Examples/JPA/WebLogic_Web_Tutorial
    http://dev.eclipse.org/svnroot/rt/org.eclipse.persistence/trunk/examples/org.eclipse.persistence.example.jpa.server.weblogic.enterpriseEJB/ejbModule/org/eclipse/persistence/example/jpa/server/business/Cell.java
    // inverse relationship
    // m-m and 1-m do not weave by default
    @ManyToMany(mappedBy="references", fetch=FetchType.EAGER)
    private Set<Cell> peers;
    // owning relationship
    @ManyToMany(fetch=FetchType.EAGER)
    private Set<Cell> references;
    See also p.101-102 of the book "Pro EJB 3"
    http://books.google.com/books?id=fVCuB_Xq3pAC&printsec=frontcover&dq=pro+ejb3#PPA101,M1
    http://www.amazon.com/Pro-EJB-Java-Persistence-API/dp/1590596455
    thank you
    /michael
    www.eclipselink.org

  • API  for updating contract Relationships for Contract Repository

    Hi all,
    what is the API used to update th Contract relationship details in oracle contracts?
    Please help.

    Hello,
    LSMW (Recording/IBIP--Change mode Is Not available in STD SAP ) Will not help you In this case.So Please go for BDC Programme.write BDC logic in such way that it will always fetch Those operation In Task List Which need to be Upadted with  Contract Numbers  by applying condtion check for those operation in task List.
    Reagrds,
    Rakesh

  • Update BP relationship from a user-exit in the BP

    Hi Everyone,
    Is it possible to update the BP relationship from within the BP, when a new BP is saved? I have a requirement to automatically create a new relationship when a BP is created. I am using BP events.
    Thanks,
    Margaret Brooker.

    Hi,
    Here is what you should do.
    Before calling BUR_BUPR_MEMORY_FILL, call FM BUP_BUPA_BUT000_GET. this gets you BUT000 data from current buffer. Here, the partner number shall be something like ##1 (as partner no is not yet determined). This is some kind of handle.
    Use this same value for partner1.
    This should work.
    Regards
    Kaushal

  • 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

  • @ManyToMany using Composite Key

    I have searched this forum concerning this issue. While I see others with a similar question, I see very little on a possible solution. Here is my problem statement.
    Class 1: Document.java
    Class 2: Collection.java
    Class 3: CollectionType.java
    XRef Table: Document_Collection
    Relationships:
    A DocumentID may be inside many collections.
    A CollectionID may have many documents.
    The owner of the relationship is document.java.
    The collection table uses 3 fields for defining a Primary Key--Site, Name, and Date. The three fields are Strings.
    I am using a SEQUENCE table for generating the unique Ids for each of the primary keys, except the Collection Table. This table is using a CompositePK Class for the Primary Key for the Collection Table.
    Document.java:
    @ManyToMany(cascade={CascadeType.ALL})
    @JoinTable(name="DOCUMENT_COLLECTION",
                      joinColumns=@JoinColumn(name="DC_DOCUMENT_ID",           referencedColumnName="DOCUMENT_ID"),
           inverseJoinColumns={@JoinColumn(name="DC_COLLECTION_ID", referencedColumnName="SITE_ID"),
                                        @JoinColumn(name="DC_COLLECTION_ID", referencedColumnName="NAME"),
                  @JoinColumn(name="DC_COLLECTION_ID", referencedColumnName="GROUP_DATE")}
    public Set<Collection> getCollectionSet() {
              return collectionSet;
    }Collection.java
    @ManyToMany(mappedBy="collectionSet")
    public Set<Document> getDocumentSet() {
         return documentSet;
    }In the Collection Class it holds a reference to a Collection type.
    CollectionType.java
    @Id
    @TableGenerator(name="COLLECTION_TYPE_TBL_GEN",
                   table="SEQUENCE",
                   pkColumnName="SEQ_NAME",
                   valueColumnName="SEQ_COUNT",
                   pkColumnValue="COLLECTION_TYPE_SEQ")
    @GeneratedValue(strategy=GenerationType.TABLE,     generator="COLLECTION_TYPE_TBL_GEN")
    @Column(name="COLLECTION_TYPE_ID", nullable=false)
    public Long getCollectionTypeId() {
         return collectionTypeId;
    }My test application builds the relationship for all the tables, and then attempts to persist the information to the database. When I look at at the log files, I see no errors, but the data is not being populated in the database. When I look at the SEQUENCE Table, I see all entries in the table are being incremented correctly except the Collection_Type sequence--still set to 1. I surmised the Collection Set for the Document_Collection table is not being populated correctly.
    My intent is to let TopLink generate the PK, Ids for the objects. This appears to be happening for the one-to-one relationships but not for the ManyToMany relationships. When I build the relationships, I create the collection and CollectionType and add it to a set. This set is added to the Document class. Lastly, I call the persist method on the Entity Manager. The log file shows the sequence number is being generated except for the Collection_Type Sequence. This may not be the correct way, but I did not see the correct steps for accomplishing this operation.
    [#|2007-08-27T16:52:03.899-0500|FINE|sun-appserver-pe9.0|oracle.toplink.essentials.file:/C:/glassfish/domains/domain1/applications/j2ee-apps/MyProject/MyEJB_jar/-MYEJBPU.sql|_ThreadID=12;_ThreadName=httpWorkerThread-8080-0;ClassName=null;MethodName=null;_RequestID=22dc7e71-9cef-4824-920f-5b3a2464c1d9;|SELECT SEQ_COUNT FROM SEQUENCE WHERE SEQ_NAME = ?
         bind => [URGENCY_SEQ]|#]This is how I build the Document Entity.
    @TransactionAttribute(TransactionAttributeType.REQUIRED)
    public Document addDocument(Document docVO) {
              entityManager.joinTransaction();
              Document doc = new Document();
              DataType dataType = getDataType(docVO.getDataType().getDescription());
              UrgencyIndicator urgency  = getUrgencyIndicator(docVO.getUrgencyIndicator().getCode());
              DocMetaData metadata = getDocMetadata(docVO.getDocMetadata().getStoragePath());
              WeaponsSystem weaponsSys = getWeaponsSystem(docVO.getWeaponsSystem().getCode());
              FileType fileType = getFileType(docVO.getFileType().getExtension());
              Date sqlDate = new Date(new java.util.Date().getTime());
              Set<Collection> collectSet = getDocumentCollection("Site", "Name", sqlDate.toString());
              doc.setUrgencyIndicator(urgency);
              doc.setDocMetadata(metadata);
              doc.setFileType(fileType);
              doc.setWeaponsSystem(weaponsSys);
              doc.setDataType(dataType);
              doc.setCollectionSet(collectSet);
              entityManager.persist(doc);
              return doc;
    }Any suggestions would be greatly appreciated.
    Russ

    Okay I figured out one of my problems. When you search using the EntityManager's find method, a null is returned should JPA not be able to find an entity. This led to not populating the Collection Type and Collection incorrectly....... Now all Sequence generators are working correctly....... However, I am still not storing information in the database. Grrrrrr

  • Update OneToMany collection from jsf page

    Hello,
    I have a problem updating a OneToMany relationship from a jsf page.
    I get an parent object via the local interface from the ejb, then I remove a child from the onetomany relationship and call my save method on the stateless bean which just merges the parent object back to the entitymanager.
    But the child I've removed gets not deleted from the database (so its in the collection again after refresh).
    So whats the preferred way to do this?
    thanks
    Dirk

    Thanks for the reply.
    I have (actually had) two problems. The first one I've solved since my initial post (stupid error on my part).
    The other unsolved problem is JSF pages displaying stale data. User navigates to first page, navigates to second page, at this point the database changes, and then the user navigates back to first page. Navigating back to the first page shows the data how it was, not how it is, because it's from the session bean and not the database. If I could kill the session bean when the user navigates from the page the problem would be solved because I build the inital display in the constructor (BTW, please advise if this is a bad approach).
    Frank, your reply raised a question. Is there a way to specify a refresh frequency? If so, how?
    Thanks,
    Al Malin

  • JPA and @ManyToMany with Association Class

    Hi!
    I need to create a @ManyToMany relationship with another field in relation table besides the primary keys of the two main tables. How can I do that? I'm using Toplink Essentials.
    Thanks.

    ManyToMany relationships having an attribute can be modeled by an extra object, e.g.:
    Assuming A has a ManyToMany relationship to B. Introduce an object, say AB, having:
    * the extra attribute xyz
    * a ManyToOne relationship A, ie. A is the "one" side, AB owns the relationship
    * a ManyToOne relationship to B, ie. B is the "one" side, AB owns the relationship
    * AB's primary key would be the conbination of the foreign keys to A and B

  • BP Relationship

    Hi All,
    1.    I have downloaded Prospects and thier Contact persons from R/3 to CRM.
    2.    In CRM i see all the prospects and contact persons.
    3.    But in the relationship tab I dont see any contact person for few Prospects.
    4.    This was because, we added a new Department for the contact persons in R/3.
    5.    In order to see the new Department in CRM, i downloaded this object     DNL_CUST_TPFK.
    6.    Now I see the newly added department in contact person.
    7.    Still I dont see the relationship tab for Prospects getting updated for contact persons matching the new department.
    8.    How do I update the BP relationship tab for Prospects and Contact persons in CRM?
    Any help/suggestions will be rewarded accordingly.
    Regards,
    Krish

    Hello Krish,
    I think that there have been errors because of the missing Department Customizing during the initial Download. You can use the Data Integrety Manager (Transaction SDIMA) to start downloading the missing Contact Persons again.
    Regards
    Gregor

  • Service Packs, Security Updates and Cumulative Updates

    I would like to find a  document that would help me understand and clarify Service Packs, Security Updates and Cumulative Updates versions and relationships.
    Things like. Cumulative Updates include old Security Updates. Cumulative Updates do not overwrite applied Security Updates, etc.
    For instance,
    I am upgrading a server from: 10.0.5512 (SQL 2008 SP3, After Security Update MS12-70)  To: 10.0.5861 (SQL 2008 SP3 CU17).
    Would the MS12-70 (2754849) I installed still be present after installing CU17? The reason for doubt was that I saw another version of MS12-70 that includes
    CU 1 to 7(KB2716435). So makes me wonder about it.
    I am probably not able to explain myself right but, the idea is to find a document that can explain how the build information and versioning works. 
    Some how I have the idea that Cumulative updates would not include Security Updates.
    Thanks beforehand
    Paulino

    Hi,
    Below will give you list of Service packs and Cumulative updates for SQL Server
    http://support.microsoft.com/kb/321185
    http://sqlserverbuilds.blogspot.co.uk/
    Security updates are for Windows not SQL Server. SQL server releases Cumulative updates after that a comprehensive service pack is released which includes all fixes that were done in Cumulative updates.
    Cumulative updates fix only a certain type of problem(for which they are created) and should only be applied if facing issue
    Service packs are more through and Inclusive and should be applied and contains many fixes and sometimes introduces few features as well. SP are more thoroughly tested as compared to CU For Cumulative
    update from Microsoft:
    We recommend that you test hotfixes before you deploy them in a production environment.
    This cumulative package is intended to correct only the problems that are described in this article. Apply it only to systems that are experiencing these specific problems.
    This cumulative update contains all the hotfixes and all the updates that were included with the previous SQL Server 2014 update release.
    Windows patch has hardly any relation to SQL server SP and CU.
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it.
    My TechNet Wiki Articles

  • New User Question : Many to Many relationship Association

    Hi
    I am trying to code a many to many relationship between two entities. One of my entity is named View and the other is Column.
    I am trying to use the @JoinTable annotation and for the table property in the annotation I am specifying a table column_view (which I have created in the database).
    My associative table has other fields, apart from the primary key of view and column entities. This makes me feel that my current way of using @JoinTable would not work under this condition and I have to create two onetomany mappings like
    Column -> OnetoMany -> ColumnView <- OnetoMany <- View.
    Am I right in my approach or is there anyother way out to represent such manytomany relationships.

    Why other fields are required in your relationshipt table?
    have only two columns and perform @ManyToMany.
    @JoinTable has to be used only on owning side.
    user (mappedBy ) on the other side
    thanks

  • UseProxyIndirection() and Breaking Relationships

    I am encountering a problem when using proxy indirection on a one to one mapping. I set up proxy indirection by calling useProxyIndirection() on the mapping at run time. I am not using the ValueHolderInterface.
    I have two objects related by a one to one mapping, object A and object B. Object A contains a reference to object B. I wish to break the relationship between the two objects. I do this by setting object A's reference to null.
    If proxy indirection is not used the database field is set to null and the relationship is broken. However if I call useProxyIndirection() on the mapping the database field is not updated and the relationship remains.
    Is there a certain method or technique that must be used to break a relationship when using proxy indirection?
    Any suggestions are appreciated.

    Setting the relationship to null should work for proxy indirection. Check that you are using the latest TopLink version, or contact support to report this problem. You might also want to try first accessing the relationship before setting the value to null.
    In general I would suggest usage of value-holders over proxy indirection.

Maybe you are looking for

  • Can't copy some files from FileVault Sparsebundle in Time Machine backup

    I've got filevault turned on for my mac Mac Mini (10.6.2). I'm using Time Machine to back up to a firewire drive. There's plenty of space - my Mini hd has 250 Gb of 500 used, and I'm backing up to a 750Gb partition on the external drive. The initial

  • How do I upload a PDF to my blog site?

    I am using an iPad and unable to upload a PDF to insert as a post in our corporate website if you could assist I would be grateful. Thank you

  • DVD-Drive detection

    Hi to all Perhaps somebody has an idea to the following problem. I'm using a 845E Max2 board and Microsoft Millennium Edition as operting system. After installing a DVD-Drive, it is correctly recognized on IDE1 in the Mainboard Bios. When Windows the

  • One finger scrolling option for mouse is GONE from preferences?

    The one finger scrolling option for mouse is apparently GONE from the mouse system preferences? Why do they move/hide this stuff every other system update? Grrrrr! I turned off the one finger scrolling option in mouse preferences a while back before

  • I dropped my iPhone.  Now my screen is blank.

    There's no cracks on the screen, but my screen is blank/black.  Siri still works, but I can't see anything on the screen.