key 1 « JPA « Spring Q&A





1. JPA not saving foreign key to @OneToMany relation    stackoverflow.com

I'm using Spring with Hibernate as a JPA provider and are trying to get a @OneToMany (a contact having many phonenumbers) to save the foreign key in the phone numbers table. ...

2. Spring - How do you set Enum keys in a Map with annotations    stackoverflow.com

I've an Enum class

public enum MyEnum{
    ABC;
}
than my 'Mick' class has this property
private Map<MyEnum, OtherObj> myMap;
I've this spring xml configuration.
<util:map id="myMap">
    <entry key="ABC" value-ref="myObj" />
</util:map>

<bean ...

3. Hibernate: Foreign key has the wrong number of columns    stackoverflow.com

I have defined a many-to-many relationship between my two entity classes User and Permission. User has a primary key composite of username and countyId, and my Permission table has a regular ...

4. Hibernate + Spring + persist one-to-one relation + empty foreign key    stackoverflow.com

I am trying to persist a one-to-one relation with Spring 1.2.8 and Hibernate 3.2.7ga but the foreign key is always empty. But let me first give you a short introduction: I have two ...

5. HibernateTemplate Composite Key fetching value null    stackoverflow.com

I have one table that has composite key 'rid' and 'sid'. For that i have made following beans to map with hibernate annotations :

WBList.java
============
@Entity
@IdClass(WBListPK.class)
public class WBList {
    private int ...

6. Duplicate key issue with Spring and Hibernate - assistance needed    stackoverflow.com

--Summary (shortened)-- I have a controller that loads a profile object from the corresponding DAO. It updates some properties, many of them sets, and then calls saveOrUpdate (via save in the ...

7. Help with foreign key mapping in Hibernate (Spring)?    stackoverflow.com

I have the following two table (which are tied in with Spring security - but the issue I believe is with Hibernate):

Table user
Table authority
The user table is tied (through Hibernate) to ...

8. how to log resource bundle key missing    stackoverflow.com

I am using http://java.sun.com/jsp/jstl/fmt tag library for outputting messages from Message Resource Bundle which is set up in Spring configuration. Also message resolving can go in Controllers. I would like ...

9. Is there anyway to get the generated keys when using Spring JDBC batchUpdate?    stackoverflow.com

I am using JDBC and want to batch insert, but I need the generated keys for the next round of inserts - is there anyway to accomplish this? MapSqlParameterSource[] batchArgs .... DAL.getNamedParameterTemplate().batchUpdate("INSERT INTO...", ...





10. TDD with HSQLDB -- removing foreign keys    stackoverflow.com

I'm using HSQLDB for data layer integration testing, which is great. However, I'm finding that my foreign key constraints are getting in the way of my tests. For example, ...

11. Spring JdbcTemplate - Insert blob and return generated key    stackoverflow.com

From the Spring JDBC documentation, I know how to insert a blob using JdbcTemplate

final File blobIn = new File("spring2004.jpg");
final InputStream blobIs = new FileInputStream(blobIn);
jdbcTemplate.execute(
  "INSERT INTO lob_table (id, ...

12. Using Spring's KeyHolder with programmatically-generated primary keys    stackoverflow.com

I am using Spring's NamedParameterJdbcTemplate to perform an insert into a table. The table uses a NEXTVAL on a sequence to obtain the primary key. I then want this ...

13. JPA mapped model returns null elements with Composite-Keys    stackoverflow.com

I have build my data model using JPA and am using Hibernate's EntityManager 3 to access the data. I used HSQLDB for testing (junit). I am using this configuration ...

14. spring jdbc and composite primary keys    stackoverflow.com

Is there a way in spring jdbc to return a composite primary key when a row is inserted. This composite primary key is made up of values from separate sequences Any help is ...

15. HibernateTemplate Save Not Throwing Exception when trying to insert duplicate Key row    stackoverflow.com

I m using Spring's HibernateDAOSupport class to handle my DAO. my problem is that when I use getHibernateSupport().save(order) when order already exist in the database, it just update the database row instead ...

16. type a simple "©" in STS on a macbook pro    stackoverflow.com

I have a simple but realy annoying problem: I just can't manage to type a simple "©" in STS (SpringSource Tool Suite) on my macbook pro. In any other editor (even plain eclipse) ...





17. Hibernate getHibernateTemplate issue when saving object inside another object    stackoverflow.com

I recently changed my code to make reference to the getHibernateTemplate(), and now my forms don't seem to save correctly, here's the code:


  public void saveForm(EcoFormFill form, int userId)
 ...

18. Spring JMX - exporting a map of key value pairs    stackoverflow.com

Is it possible, ideally using the spring JMX annotations, to export a map of key value pairs where the key is used as the exported attribute name? If so, how? Thx.

19. hibernate circular foreign key    stackoverflow.com

I have to test some code I have not myself written. It is an integration test: the application is running continuously on a server and my tests run against it. The tests ...

20. How to set the fields of an object given a map of key/values?    stackoverflow.com

I want to implement something similar to the JobDetailBean in spring http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/scheduling.html#scheduling-quartz-jobdetail where a map of properties can be applied to an object to set its fields. I looked through the spring ...

21. spaces in message bundle keys    stackoverflow.com

I want to be able to have spaces in my message bundle keys because it is easier to convert existing text into keys if you dont have to also convert spaces ...

22. Oracle Batch Insert w/No Primary Key Missing Inserts    stackoverflow.com

I'm trying to insert over 100,000 records into an Oracle 9i table with no primary key using the ojdbc14.jar driver and Spring's SimpleJdbcTemplate batchUpdate method. Here's my code snippet:

private static ...

23. Getting timestamp of last insert in mysql along with primary key in a single query?    stackoverflow.com

I tried searching for the solution to this problem but am still stuck. Seems rather simple (or maybe it's my ignorance :) I already fetch the 'auto incremented' primary key after inserting. ...

24. BatchSqlUpdate - how to get auto generated keys    stackoverflow.com

I am using spring BatchSqlUpdate to insert a set of rows. How do I get the auto generated keys for all of the rows inserted? When doing a single insert I ...

25. Mapping ManyToMany with composite Primary key and Annotation:    stackoverflow.com

I'm trying to create manytomany realation between Student and Teaching Course using Composite Primary key: my classes:

Entity
@Table(name="Student_mtm_cId")
public class Student {

    private String id;
    private Set<StudentTClass> teachingClasses ...

26. Persisting an object in Hibernate while having a known primary key.    stackoverflow.com

My problem is with detached objects... I am currently using Spring with Hibernate. I have a mapped object that has a primary key as a String (I know it sucks... but refactoring the ...

27. IntelliJ - navigating between Spring config and classes with keyboard, and using icons on outline with keyboard    stackoverflow.com

I would like to know if there is a keyboard shortcut that would move between Spring config and its classes (icon on editor outline with mouse click). And one more thing is ...

28. ETL into operational oracle database - used by jsp/spring/hibernate app    stackoverflow.com

I am needing to have some legacy data loaded into an operational oracle (11gR2) database. The database is being used by a jsp/spring/hibernate (3.2.5.ga) application. A sequence is used for generating ...

29. I need to carry forward the primary table's primary key to a foreign key field in dependent table    stackoverflow.com

I have 2 entities Customer and address please find the code below, I have omitted boiler plate code for simplicity.

public class Customer  implements java.io.Serializable {
  private static final ...

30. Mapping of composite key with both elements as foreign key    stackoverflow.com

I have a simple Spring-Hibernate application. I have 3 classes crop, market and farmer with structure something like :

class crop  
{  
    private int cropId;  
} ...

31. Ehcache Spring- custom key generator    stackoverflow.com

I was working with spring-ehcache-annotations and came across following scenario: I have a simple POJO as follows

class Person{
 private Long id;
 private String name
 //some code
}
Now in DAO I have
public ...

32. level1 cache for queries / other unique keys in spring/JDO/Datanucleus?    stackoverflow.com

I use a the DN/JDO level1 caching a lot. Although I mostly query by primary key, some repeating queries are perfomed using other unique fields. (like userid vs. username). Is it ...

33. "key" name for the id gives errors on submit    forum.springsource.org

"key" name for the id gives errors on submit Hello all, here is what I observed: I have a class "Group" whose identifier is a string named "key", with accessors getKey() ...

34. UnsupportedOperationException with composite primary key    forum.springsource.org

UnsupportedOperationException with composite primary key The database reverse enginnering works fine for the entity named 'SystemCapacity'; but when I try to generate a controller for it, I get the UnsupportedOperationException.

35. DBRE and intertable/foreign key relations in MySQL for example    forum.springsource.org

If I use DBRE on a MySQL database then roo can figure out primary keys - but not other foreign keys. The database doesn't know about them, so roo doesn't either. ...

36. Can't define a util:map with a non-String key    forum.springsource.org

Can't define a util:map with a non-String key Using Spring 3.0.5 with JDK 1.6. I'm trying to define a Map whose key type is an object with three properties, and whose ...

37. DBRE does not generates foreign keys for me!    forum.springsource.org

Hi all, I'm using DBRE over Oracle 10.2.0.1.0 to build a ROO application. Reverse engineering seems to work at first, however whenever I try to test integration over a single entity ...

38. Problem generating @JoinColumn at composite primary keys    forum.springsource.org

Problem generating @JoinColumn at composite primary keys We are using the addon DBRE on a project with many tables, all of them with composite Primary Keys. We have discovered a bug ...

39. Keys padded with hex    forum.springsource.org

Hi guys, I'm using Spring Data Redis 1.0.0.M1 and Data Commons* 1.0.0.M2 When I INCR a key, or SET a key, I see the following in the Redis-cli monitor, for e.g. ...

40. Error after trying to save duplicated key    forum.springsource.org

Feb 13th, 2011, 11:19 AM #1 tinnakorn.c View Profile View Forum Posts Private Message Junior Member Join Date Feb 2011 Posts 1 Error after trying to save duplicated key I'm currently ...

41. Keyboard as input source    forum.springsource.org

Hi, I am trying to create a proof-of-concept Spring Integration application which reacts on input from the keyboard. The flow I am trying to create is: 1. Receive input from keyboard ...

42. CreateQuery problem with compund keys    forum.springsource.org

Feb 25th, 2011, 03:31 AM #1 thomas123456 View Profile View Forum Posts Private Message Junior Member Join Date Feb 2011 Posts 5 CreateQuery problem with compund keys Hi I have a ...

43. Get Request instead of Post request with enter key    forum.springsource.org

Hi, I have a web page that supports submit with enter key. I need a post request on submit. But sometimes when I submit the form with enter key, it makes ...

44. Problem inserting data with composite primary keys    forum.springsource.org

Problem inserting data with composite primary keys Problem from a newbie: I have a composite primary key like this: package model; imports ... @Embeddable public class CopyId implements Serializable { @Column(name="copy_no") ...

45. Util:Map not assigning the proper key    forum.springsource.org

Util:Map not assigning the proper key I am using Spring 3.0 and I am leveraging the util:map to keep a map of my internal objects with the key being the look ...

46.  BUG when 1 digit map key    forum.springsource.org

Code:

${item.attrNo}

47. finder list for primary key    forum.springsource.org

If you reverse engineer a table you don't have the ability to list the available finders for the primary key. The table that I have reverse engineered has the primary key ...

48. composite primary key and autogenerated field    forum.springsource.org

composite primary key and autogenerated field Hi friends, I have this configuration.... Code: @Embeddable @SequenceGenerator(name="SEQ_PATINMOBILIARIO", sequenceName="PATINMOBILIARIO_ID") public class PatInmobiliario_PK implements Serializable{ private int codigo; private int declaracion; @Column(name="PI_CODIGO") @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="SEQ_PATINMOBILIARIO") public ...

49. dbre mysql 'Foreign key table for foreign key' 'must not be null'    forum.springsource.org

dbre mysql 'Foreign key table for foreign key' 'must not be null' Given the following mysql database definition for user 'sa' and no password: Code: -- DROP SCHEMA IF EXISTS rootest; ...

50. SpringDataJpa - Cannot use Pageable with an Entity that has a composite key & Oracle    forum.springsource.org

SpringDataJpa - Cannot use Pageable with an Entity that has a composite key & Oracle This is a Spring Data JPA issue. When using Pageable with Oracle & Hibernate on an ...

51. primary key index performance    forum.springsource.org

52. findOne returns no results when using Composite keys    forum.springsource.org

I really liked the Hades project and quickly moved to Data JPA. Initially the Data model was with surrogate keys and data jpa worked absolutely fine. Now the architects decided to ...

53. how to join two lines based on the key by using ItemReader    forum.springsource.org

Hi , I have a file called input.txt a hello a world b spring b batch I need to read the above content and write into output file by using below ...

54. Unable to initialize due to invalid secret key    forum.springsource.org

Unable to initialize due to invalid secret key Hi, I am using Spring social and I am trying to use the Encryptors.queryableText() to encrypt the accessTokens and secret keys. However the ...

55. facing problem while working with composite primary key    forum.springsource.org

facing problem while working with composite primary key hi, iam using composite primary key in my application,between domain and emailid.Here the domain will be a hidden field,i should get the domain ...

56. @OneToMany with composite key    forum.springsource.org

@OneToMany with composite key I have a One to One relation between Employee and Role table with EmployeeRoleMap as the join table. I have tried using the Join table and it ...

57. Multithreaded Resequencer with sequence key    forum.springsource.org

Hi, Please, help to implement next use case with Spring Integration: I need to process messages coming to channel in multiple threads but messages with same sequence key (can be calculated ...

58. Help with list/show/update composite key?    forum.springsource.org

Help with list/show/update composite key? I'm trying out Roo to see if it can help us quickly produce CRUD applications. We've got a few tables I've reverse engineered that have composite ...

59. Spring Data JPA - Repositories for Entities with Compound Primary Key    forum.springsource.org

Is there any way using Spring Data repositories with entities having a compound key (i.e. being annotated by @IdClass (my.special.entityPK.class) ) ? I miserably failed do do so! As an aside: ...

60. Meaningful ID (primary key) setup - aka Hibernate GeneratedType assigned. Howto?    forum.springsource.org

Meaningful ID (primary key) setup - aka Hibernate GeneratedType assigned. Howto? Hi, I just started with Roo 2 days ago. I am fairly new to Hibernate, Tiles etc though experienced in ...

61. Primary key type mismatch error    forum.springsource.org

Sep 17th, 2011, 05:19 AM #1 mwarren2 View Profile View Forum Posts Private Message Junior Member Join Date Sep 2011 Posts 15 Primary key type mismatch error I have Postgres database ...

62. Best practice for posting entites via AJAX that have composite keys    forum.springsource.org

Best practice for posting entites via AJAX that have composite keys So I understand that for entities that have composite keys, Roo creates an application conversion service for encoding/decoding a JSON ...

63. Help! Generated key not set in entity object after merge    forum.springsource.org

Help! Generated key not set in entity object after merge Ok, I have a pretty involved setup, but basically it boils down to this: Spring wrapped Hibernate on Oracle 11g I ...

64. spring hibernate compsite key    forum.springsource.org

65. help!!!jsp loop for:each of a map contains >    forum.springsource.org

help!!!jsp loop for:each of a map contains > Hi, I have a command bean that contains a map coppiePerOffertaMap>(LinkedHashMap ) with set and get method I have to ...

66. util:map with Enum Key and POJO Value    forum.springsource.org

I have a map defined in Spring configuration as follows: Code: I am finding this error: Code: Caused by: org.springframework.beans.FatalBeanException: Key type ...

67. @Cacheable key generation questions    forum.springsource.org

@Cacheable key generation questions Hi I am using the new @Cacheable annotation with keys defined via SpEL. @Cacheable(value="oftenUpdatedCache", key="'relationList' + #p0 + #p1") a) In order to be able to supply ...

68. Problem with Composite primary key in SpringData    forum.springsource.org

Nov 21st, 2011, 10:29 AM #1 alex_kot View Profile View Forum Posts Private Message Junior Member Join Date Nov 2011 Posts 6 Problem with Composite primary key in SpringData Hi, My ...

69. Primary Key Contraint    forum.springsource.org

Primary Key Contraint Does it require to have a primary key column in tables to use hibernate. I have read the article which says that it is required to have primary ...

70. Key type other than String    forum.springsource.org

After looking through the documentation, mailing lists, and this forum, it appears that the key of a map within the application context can only be a string. Code: ...

71. Identity Key Retrieval after saveOrUpdate    forum.springsource.org

i have a generic DAO which uses the getHibernateTemplate().saveOrUpdate() to save objects to my sql server db. after saving, i need to get a handle on the id that was generated... ...

72. Associating error messages with fields that are map keys    forum.springsource.org

Hello Daniel, to link an error message to a field held in a Map, you just have to name the field name the same way as you do in your view ...

73. JDBC RowMapper and foreign keys    forum.springsource.org

JDBC RowMapper and foreign keys When mapping a row from a ResultSet, how should I handle foreign keys that represent domain objects? Example: When loading a row from the Order table, ...

74. Map Entries with objects as keys    forum.springsource.org

75. Can BeanWrapper resolve Maps with non-string keys?    forum.springsource.org

Can BeanWrapper resolve Maps with non-string keys? I know that BeanWrapper will bind Map properties where the key is a String. I also know that I can get BeanWrapper to convert ...

76. Inserting foreign key    forum.springsource.org

Inserting foreign key Hi all, I want to insert a foreign key by referencing to another class. Here is my mapping configuration: Code:

77. one-to-one foreign key assosciation    forum.springsource.org

one-to-one foreign key assosciation I have a one-to-one mapping based on a foreign key association. It is able to pull the related data. The problem is: when saving it does not ...

78. popup menu. escape key, and cancel command    forum.springsource.org

popup menu. escape key, and cancel command This may not be an issue with RCP specifically, but maybe someone here knows how to deal with this. I have a dialog with ...

79. Auto incrementing keys    forum.springsource.org

Auto incrementing keys Can anyone advise me on the best way to use an auto incrementing primary key with Spring and MS SQL Server ? In the book 'Spring in Action' ...

80. Class as Map Key    forum.springsource.org

Class as Map Key Hello, Is it possiable to have a Class object be a key for a map. Currently when I inject it with spring , my key is a ...

81. insert blob and return generated key    forum.springsource.org

insert blob and return generated key Can anyone advise me on how to return Generated Keys whilst also inserting a BLOB ? My code to insert the BLOB isa as follows: ...

82. Hibernate Key Classes    forum.springsource.org

Hibernate Key Classes I am still fairly new to Hibernate, so please forgive me if I am asking a question that is documented somewhere. (I could not find a documented answer ...

83. How to retrieve objects with composite keys using Hibernate?    forum.springsource.org

Anybody knows how to do that? I cant seem to find a method in HibernateTemplate that does that. Do I have to use JdbcTemplate to access these kind of objects? Maybe ...

84. How can i determine foreign key violation exception    forum.springsource.org

I am using spring+hibernate+postgreSQL 7.4 I want to show customize message for the foreign key violation exception. How can it be done. Can i get the postgreSQL error code for foreign ...

85. Spring adding a comma to my primary key for saving    forum.springsource.org

Spring adding a comma to my primary key for saving Hello, I have created a program using the petclinic application as a model. I am using hibernate 3.1 and spring 1.2.6. ...

86. how to change map entry key type ?    forum.springsource.org

Is there way to change a key type from the default String to something else, when defined in: ..... I need to use Integer wrapper class. Any clues ...

87. problem regarding primary key    forum.springsource.org

Apr 3rd, 2006, 03:46 AM #1 shahzad992 View Profile View Forum Posts Private Message Senior Member Join Date Nov 2005 Posts 148 problem regarding primary key hi, i am using hibernate ...

88. loading class with composite key indentity    forum.springsource.org

89. how to handle multiple submit buttons when enter key pressed    forum.springsource.org

how to handle multiple submit buttons when enter key pressed Hi guys, iam using wizard controller not exactly like its suppost i mean not way. i have a form ...

90. Foreign-Key is null    forum.springsource.org

Foreign-Key is null I reconvert all my Hibernate-Mappings from XML to Annotations. Now there are problems with my one-to-many associations. Consider my old XML-Mappings: Code: ...

91. Inserting foreign key value with form:form tag    forum.springsource.org

Inserting foreign key value with form:form tag Hi there, I wanted to insert a value that is an instance of another class using form:form tag. But it seems not working. I'm ...

92. CasAuthenticationProvider Key    forum.springsource.org

The class org.acegisecurity.providers.cas.CasAuthenticationP rovider has a parameter called "key". The code says "A Key is required so CasAuthenticationProvider can identify tokens it previously authenticated". What should this key be set to? ...

93. Updating old code: what happened with ListBinder.MODEL_KEY in v0.2 ?    forum.springsource.org

Updating old code: what happened with ListBinder.MODEL_KEY in v0.2 ? Hi, I'm migrating from a very old, previous version of 0.1 to the head of the project and I'm experiencing some ...

94. List and ComboBoxBinder.COMPARATOR_KEY    forum.springsource.org

List and ComboBoxBinder.COMPARATOR_KEY Hello, The SwingBindingFactory is creating BoundComboBox and BoundList with inverse order of elements. I'm a bit confused but I think the constructor of PropertyComparator is inverting the idea ...

95. configuring complex map keys    forum.springsource.org

configuring complex map keys Hi, I have a bean that needs to be initialized with a Map whose keys are not Strings but a user-defined class, how could I do this? ...

96. Nachocalendar via keyboard...    forum.springsource.org

Nachocalendar via keyboard... Hi *, I was wondering if people were using NachoCalendar for their date mapping? I have done so for a while and have used version 0.22 and 0.23. ...

97. Appropriate keyboard accelerator for Mac OS    forum.springsource.org

Hi Everybody! I'm currently evaluating Spring Rich Client for an upcoming project. So far it seems to help very much. Great thing. Our aim is to provide our solution on Win ...

98. Hibernate Annotations - Combined Primary Key?    forum.springsource.org

99. Table with Composite key Adding Annotations ?    forum.springsource.org

Table with Composite key Adding Annotations ? hi all, Can anyone help me how to map using Hibernate Annotations to a table with two columns combine to form a Primary key. ...

100. Possible to use non-Strings as Map keys with EL?    forum.springsource.org

I have a map of objects in my command object keyed on an Integer. When I try to use a tag to set a value in one of the objects Spring ...