Generic 1 « Map « JPA Q&A





1. How to avoid type safety warnings with Hibernate HQL results?    stackoverflow.com

For example I have such query:

Query q = sess.createQuery("from Cat cat");
List cats = q.list();
If I try to make something like this it will show warning "Type safety: The expression of type ...

2. Hibernate Query API and Java 1.5/Generics    stackoverflow.com

All APIs in Hibernate are from 1.4 and are thus not using java generics. So I wonder how "safe" the following is: (preconditions: name column is of datatype String, or atleast compatible ...

3. Java generics question - Class vs. T?    stackoverflow.com

I'm using Hibernate validator and trying to create a little util class:

public class DataRecordValidator<T> {
    public void validate(Class<T> clazz, T validateMe) {
       ...

4. Typesafe Primary Key in Hibernate/JPA    stackoverflow.com

I am looking for a way to have a typesafe primary key for my entities using generics in Hibernate. Instead of doing this

@Entity
public class User{

@PrimaryKey
Long id

}
I was thinking of doing ...

5. Value of 0 in Hibernate IndexColumn mapped with base=1    stackoverflow.com

We are using Hibernate Annotations 3.4.0GA and Hibernate Core 3.3.2.GA (also known as the current stable versions) against an Oracle database We have a One-to-Many mapping with base=1 which worked fine for ...

6. How to handle JPA annotations for a pointer to a generic interface    stackoverflow.com

I have a generic class that is also a mapped super class that has a private field that holds a pointer to another object of the same type:

@MappedSuperclass
public abstract class MyClass<T ...

7. Dynamic Inheritance - Java    stackoverflow.com

Dynamic Inheritance I have a situation where I want a class (which is a JPA entity) to be able to extend either class A or class B dynamically. My thought was to ...

8. Hibernate and generics    stackoverflow.com

In Java I have a class tha has a payload of type T

public class GenericStatus<T> {
   private MyDateRange myDateRange;  
   private T payload;
At runtime T can ...

9. unchecked generics usage warning on getAllClassMetadata() instance method of org.hibernate.SessionFactory    stackoverflow.com

I just cant understand this. I'm calling

AnnotationConfiguration annotationConfiguration = new AnnotationConfiguration();
SessionFactory sessionFactory = annotationConfiguration.configure().buildSessionFactory();
Map<?, ?> allClassMetadata = sessionFactory.getAllClassMetadata();
Well, the only way I don't have warning is if I'm using wildcard ? ...





10. Java Generic DataSource aggregation framework    stackoverflow.com

I there a framework that i can use to wrap various datasources and make the datasource specific details transparent to the client. Eg a wrapper that can wrap both a jackrabbit ...

11. Java Generics error when implementing Hibernate message interpolator    stackoverflow.com

Framework: Spring, Hibernate. O/S: Windows I am trying to implement hibernate's Custom message interpolator following the direction of this Link. When implementing the below class, it gives an error "Cannot make ...

12. generic data grid filtering    stackoverflow.com

I have been working on a generic solution to filter data using Nhibernate. The code looks like this:

private ICriteria GetPagedCriteria<T>(GridResult<T> GridResult, bool sort)
        {
 ...

13. JPA generic field    stackoverflow.com

Is it possible to persist a generic field? I have this property on an Entity class

...
private T payload;
...

T extends EventMessagePayload
and
public interface StringPayload extends EventMessagePayload{ 
    String getPayload();
}
In my ...

14. Generic approach of using LIKE, PERCENT and CONCAT in a JPQL query    stackoverflow.com

I'm doing some JPA 2.0 queries inside my JEE6-app, where i use Named Queries with Parameters. My current query is a "find-by-all" query with just one parameter.

@NamedQuery(name = "UserPE.byAny", query = ...

15. Java Persistence Criterias; Cast Expression to Expression?    stackoverflow.com

I am using the CriteriaBuilder and CriteriaQuery to build my query to the database, but I have encountered an issue that I do not know how to solve, since I am ...

16. HQL query results "cannot be used in this generic collection" when returning a subclass    stackoverflow.com

Given the following: A Company has a collection of Product objects.
An Area has a collection of Product objects.
Any given Product has a Company and an Area.
SpecialProduct is a subclass of Product. I'm using ...





17. HQL generic mapped class    stackoverflow.com

Have this C# FNH config:

public class MapTag : ClassMap<Tag<Expense>>
Both Tag and Expense has a parameterless constructor. How do I write an HQL that gets all Tag? _"from Tag<Expense>" ...

18. Deserialize java generics collection with json    stackoverflow.com

I am trying to serialize and dederialize an answer from hibernate.
almost successfully.
First I get the data (object DealBean) from the DB using

Collections.checkedList(session.createCriteria(DealBean.class).add(Restrictions.eq("account", account)).list(), DealBean.class);
then I serialize it (using gson) and ...

19. Generic object returned instead of class entity in hibernate query    stackoverflow.com

I am running a hibernate query which is returning an Object instead of the correct entity object. The statement is as follows:

public List getPriorBids(String rfpCD, String carrierCode) {
   ...

20. Generic ADO.Exception NHibernate    stackoverflow.com

I have this table: TABLE "Set": [PK:IdSet (int), IdProject (int),IdSetState(int),IdPriority(int),NumSet(int),Unit(nchar),NumDisc(int)] So, I make the Test NUnit for insert a value in this table. This is my Test method:

[Test]
public void Can_add_Set()
{
   ...

21. Hibernate mapping for parameterized classes    stackoverflow.com

I've been wondering for some time if it was possible to use Hibernate with parameterized classes. Can it handle something like this? Is there some other way to do it?

class Auto<Autotyp extends ...

22. Generics and the Play Framework    stackoverflow.com

I am using the Play Framework in it's current version and my model classes extend play.db.jpa.JPABase. Today I tried to make an often used type of query generic and define a ...

23. Why are Java value objects coming back as Generic Flex objects?    stackoverflow.com

I will try to give as much detail as I can. I am creating an CRM application using Flex(Cairngorm 2)/Java/Hibernate. The basic problem I am having is this: I have a Customer class ...

24. Using hibernate with generics    stackoverflow.com

I am having some trouble understanding how Hibernate deals with generics and was wondering the best way to accomplish my goal. Given a simple generic entity:

@Entity
public class Box<T>{

  private T t; ...

25. hibernate and generic field mapping    stackoverflow.com

I want to map a generic field in a superclass with Hibernate. My mother class is :

@Entity
@Table(name = "ParameterValue")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "parameterType", discriminatorType = DiscriminatorType.STRING)
public abstract class ParameterValue<C>
{
   ...

26. How to map Java generic instances with Hibernate    stackoverflow.com

I'm trying to map Generic types in Hibernate. I've searched and couldn't find clear answers how to do it. Help will be much appreciated. Here are some example classes:

public class Person {
 ...

27. Eclipse warning: Type safety (Java Generics)    stackoverflow.com

I have the following Hibernate code:

List<Book> result;    

result = hibernateTemplate.execute(new HibernateCallback() {
        public Object doInHibernate(Session session) throws HibernateException, SQLException {
  ...

28. Dozer mapping non-Generic Collections to properties    stackoverflow.com

I have some class structure as follows. These classes are hibernate classes so I cant change them.

//assume all getters & setters are present 
public class Order{ 
    private ...

29. How can I wrap Play/JPA's Model class with a generic Repository?    stackoverflow.com

I don't like working with models objects directly, because this breaks encapsulation. Instead, I prefer the Repository Pattern. When I try to implement a simple repository

public abstract class BaseRepository<T extends Model> ...

30. Create a generic method that used JPA2 and CriteriaBuilder    stackoverflow.com

I'm developing a web application that use JSF2 and JPA2 frameworks. I started using the wizards on netbeans7.0 and the "New JSF Pages from Entity Classes" created a classAbstractFacade" contains this useful ...

31. How to define Generic Collection types in JPA Entity table column    coderanch.com

Hi All, I am trying to define a generic Collection List type into an Entity table column such as the following: @Entity @Table(name="EMPLOYEE") public class Employee implements Serializable { @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column(name="ID", nullable=false, columnDefinition="long") private long id; public long getId() { return id; } public void setId(long id) { this.id = id; } @Column(name="SURNAME", nullable=false, columnDefinition="String", length=80) private String ...

32. Generic Hibernate Fetching    coderanch.com

public class Item { private String name; private Set categories = new HashSet(); private Set bids = new HashSet(); private Bid successfulBid; ... } ---------------------------------------------------- public class Bid { ... private Item item; ... } ----------------------------------------------------- public class User { private Address shippingAddress; private Set billingDetails; .. } ----------------------------------------------------- public class Category { private String name; private Category parentCategory; private Set ...

33. Generic where column in JPA join    coderanch.com

I have a column called "active" in most of my tables and I would like to apply a generic where active=true to the all the joins without explicitly declaring it in each where down through the select. Ideally in the Join column annotation there would be an attribute that would allow qualifying that join such that it only ever comes back ...

34. generics and hibernate    coderanch.com

Hello, Well first of all, this is my first post. So hi! Second of all, following full disclosure, this is cross-posted on stackoverflow however there were a lack of answers so I decided to reach out further. Given the following Java class: @Entity public class Box{ private T t; @Id private long id; public void setT(T t) { this.t = t; ...

35. General idea about generics and JPA 1.0    java.net

The implementation crashes, as it failes to determine the type for T. I think this is no bug of the implementation, since it's simply not covered by the JSR-220 spec. My workaround was to change the access for the property accessors to the raw type List and annotate the property with "targetEntity = Bar.class". I get the expected warning about the ...

36. Foreing keys using generics not working as expected    forum.hibernate.org

Hello, I'm using Hibernate on JBoss 4.3.2 using standard JPA annotations. I have the following classes: Code: @Entity @Inheritance(strategy=InheritanceType.TABLE_PER_CLASS) public abstract class A { } @Entity @Inheritance(strategy=InheritanceType.TABLE_PER_CLASS) public abstract class B { @OneToOne private T foreing; } @Entity public class A1 extends A { } @Entity public class A2 extends A { } @Entity public ...

37. Persisting a "generic" set of objects    forum.hibernate.org

I have this doubt for some time, couldn't find any info in my documentation, it's about how Hibernate persists a "generic" set of objects: Suppose we have a class Customer with a Set of Automobile: Set Truck and Motorcicle are generalization of Automobile. How do hibernate store this set of Automobile if I add Motorcicle and Truck objects on it? How ...

38. Java 5 Generics and Object    forum.hibernate.org

I'm having problems mapping Generics in Hibernate. Our database tables are all designed the same way and each table has an identifier with ID and DATE. ID can be an Integer or a String. I created a generic class, which can accept Integer or String as valid types for the ID-field. So far so good. However, Hibernate doesn't know the type ...

39. Bug on Hibernate 3.5 and 3.5.1 related to Generics.    forum.hibernate.org

Newbie Joined: Fri Apr 09, 2010 5:49 am Posts: 9 I tried migrating my project from hibernate 3.4 to hibernate 3.5, and it seems there are problems with generics. I post my example entities... similar to the one I have it (that are to complicated). I get an error in the mapping of the OneToMany associationg. First entity Code: @Entity public ...

40. Generics with wildcard bug    forum.hibernate.org

SEVERE: an assertion failure occured (this may indicate a bug in Hibernate) org.hibernate.annotations.common.AssertionFailure: Fail to process type argument in a generic declaration. Member : de.lsb.sample.persistenceinfrastructure.basic.domainmodel.entity.account.implementation.AccountImplJPA#histories Type: class sun.reflect.generics.reflectiveObjects.WildcardTypeImpl at org.hibernate.ejb.metamodel.AttributeFactory$PluralAttributeMetadataImpl.getClassFromGenericArgument(AttributeFactory.java:846) at org.hibernate.ejb.metamodel.AttributeFactory$PluralAttributeMetadataImpl.(AttributeFactory.java:756) at org.hibernate.ejb.metamodel.AttributeFactory$PluralAttributeMetadataImpl.(AttributeFactory.java:731) at org.hibernate.ejb.metamodel.AttributeFactory.determineAttributeMetadata(AttributeFactory.java:518) at org.hibernate.ejb.metamodel.AttributeFactory.buildAttribute(AttributeFactory.java:93) at org.hibernate.ejb.metamodel.MetadataContext.wrapUp(MetadataContext.java:183) ...

41. Mapping collection with interface as generic type    forum.hibernate.org

Newbie Joined: Tue Jul 27, 2010 9:46 am Posts: 2 Hi everyone! (it's my first post on hibernate forum) At the beginning I would inform that I am hibernate newbie, so your patience is very appreciated. My question refers to mapping the following class hierarchy: (the following code is complete and ready to run if you wish to try it in ...

42. Creating generic SQL query using setParameter    forum.hibernate.org

Thank you both. Unfortunately I am using a JPA implementation that doesn't allow criteria, not Hibernate. Now I am having this problem: the value field is String but I wanted to pass anything there (string, double, int...). The problem is that setParameter needs to know the actual type of value, or it will return empty when trying to search for a ...

43. Generic Question about Hibernate Development    forum.hibernate.org

Hi All, we are working on a web application where my team is responsible for the development of the core functionality of the application and development of ORM layer is the main area of concentration. We have already pointed out all the major entities and other main component with respect to persistence layer and have started out implimentation for the same. ...

44. Generics with JPA    forum.hibernate.org

I had the setter originally in the base class. If i moved the getter and setter to the concrete class and remove the generics, it seems to work. But i would prefer to keep it in the base class, so i don't need to re-implement the getter / setter in every subclass.

45. How to map a generic sql at rutime    forum.hibernate.org

46. Generic SQL subselect statement for clob (select, group by)    forum.hibernate.org

Hi All, I've declared a Hibernate column as type "text" and internally we created the column as "longtext" in MySQL, "nvarchar" in SQL Server and "CLOB" in Oracle. I've defined a view in subselect in hbm file and it works fine for mysql but it failed in other databases since i've selected the above clob field and used in group by ...

47. JPA and generics    forum.hibernate.org

48. generic way to get the index of a collestion    forum.hibernate.org

I notice that PersistentCollectionType has a method to generically interate over the elements of a collection, but not the index values. Is there any particular reason for this? I know that indexes are pretty much only useful for Maps, but the lack of a getIndexesIterator method seems comspicuously absent and I'm wondering if there's something I'm missing.

49. Span/generics support, as in ObjectSpaces?    forum.hibernate.org

50. generic class to hold mapped data for dynamic data models    forum.hibernate.org

I have a somewhat unique requirement: our database can be enhanced by the client - so in my application I do not control all the tables. However, I can dynamically determine the table and column names, PK and FK relationships. Short of dynamically generating the required class and the the mapping - how can I use Hibernate to dynamically define a ...

51. mapping one generic class to a table dynamically    forum.hibernate.org

Hello, I would like to map a "meta-class" to a table depending in the values from the meta- class. The usual way to map classes to tables is that you have a class named "Car" and a table named "TABLE_CAR" and you do the mapping in hqm. I want to map a class named "GenericClass" to a table named "CAR" if ...

52. Java Metadata and generics    forum.hibernate.org

53. left join of collection results in generic java.lang.Object    forum.hibernate.org

Hello, I'm using Hibernate 2.1.2/MySQL 3.26 for a Tibetan Dictionary application and now I am struggling with an HQL query that joins a collection but returns objects of class java.lang.Object that are of course not castable to any mapped subclass. I'm trying to set constraints in the where clause based on values of objects in an indexed collection. I've solved all ...

54. is this a generic clusterable id generator    forum.hibernate.org

JBoss jBPM Developer Joined: Thu Aug 28, 2003 11:56 am Posts: 30 Location: Belgium Hi guys, I have written something that I think is a generic clusterable id generator. It doesn't require your db to support locking and its all written in standard java (no j2ee dependancies). I want to know 1) if you can spot a flaw in the ideas ...

55. Returning unmapped generic Java types from createSQLQuery    forum.hibernate.org

Is it possible to return generic Java Types using an SQLQuery ? List list = sess.createSQLQuery("SELECT count(*) FROM FXOData", "", Object.class).list(); The above code returns an Integer that is an unmapped type. When I run the query I get. net.sf.hibernate.MappingException: No persister for: java.lang.Object Is there any way to do this in hibernate ? Many Thanks Alan

56. Generic Query parameters    forum.hibernate.org

57. How can I use one "generic" Getter for a set of pr    forum.hibernate.org

Hi, I'm using Hibernate 2.1 and couldn't quite figure out how to write a custom property accessor that is capable of mapping between the properties of a Java class and the database columns where the java class does not have JavaBean style getters/setters for most of the properties. My Java class basically has the followng structure: public class Foo { private ...

58. Hibernate3 and Generics    forum.hibernate.org

59. generic BLOB / CLOB strategy for Oracle, MySQL and Postgres    forum.hibernate.org

Newbie Joined: Thu Jan 29, 2004 5:33 am Posts: 9 Hi all, I'm another Hibernate user who resents the incompatibility that the major databases (don't feel offended if your favourate db is not in the subject :) show with respect to clobs and blobs. Because the problems are generally the same for clobs and blobs, I will continue to call them ...

60. Generic strategy for managing blobs    forum.hibernate.org

I am using hibernate to manage persistence and i was wondering whether there was a generic strategy for managing blobs. For MySQL i want to map this property to a longblob but i do not want to specify the sql-type since I want to eventually support other database types. Is there a best practice for handling this scenario?

61. Generic table example    forum.hibernate.org

Hi, I have a generic 'Cost' table. Two other tables (Car and Bike) share this Cost table. So (for instance), instead of having: table cost { cost_id number, bike_id number nullable, car_id number nullable, amount number } I have: table cost { cost_id number, linking_id number, linking_type varchar(2) amount number } So in future, if a new entity wants to have ...

62. Java 1.5 Generics unchecked conversion warning    forum.hibernate.org

Using: hibernate version 2 jdk 1.5.0_01 (in Eclipse version 3.1 - stable build) I am getting a compile time warning when I retrieve a List of objects through hibernate and try to cast it to a generic List ie. Code: public List getObjects() { List objects = null; try { ...

63. generic prefetching    forum.hibernate.org

Hibernate version: 3.0.5 I know that you can configure your mapping files with eager fetching, subselect fetching, batching, etc., and you can also use join fetching in HQL queries or equivalent in the Criteria API, but is there any way to prefetch relationships on a specific set of objects without refetching the source objects, or modifying the mappings? What I am ...

64. Hibernate 3 mapping of Java 5 Generics    forum.hibernate.org

I'm not asking about a generic collection. I'm asking about a generic class created by the user. As a quick example: class MetaData { private T object; private long metadata; } How would Hibernate map this type? I think I can write a Parameterized UserType class to do it, but I was hoping that Hibernate would have built in support for ...

65. Generic Blob retrieval?    forum.hibernate.org

66. generic validation mechanism    forum.hibernate.org

Hibernate version: 3 Name and version of the database you are using:Sql server 2000 Struts version: 1.2.7 Hi, I'm building a simple webapplication with struts and hibernate and I'm trying to achieve the following behaviour: When an object is saved it is first validated by Struts. You have great design patterns for this. However since I've already specified the size and ...

68. Java 5.0 Compliance with generics and queries    forum.hibernate.org

java 5.0 update 4 Hibernate 3.1 Eclipse 3.1 Does anybody have any examples of using generics (java 5.0) with Hibernate 3.1, any queries I do, I have to preface the method call with @SuppressWarnings("unchecked"), I'd really like to be to get rid of that annotation. I've almost got it, except for the Session.createQurey() method. List honeys = session.createQuery( "from Honey order ...

69. Persisting Java 5.0 generics    forum.hibernate.org

Hi everybody, Is it possible to persist a generic type with Hibernate (3+) ? And if it is, is there a special grammar to apply to the mapping file ? I have a custom generic class, which takes one instance of the specified type as one value object (so maybe a polymorphic mapping is possible). Thanks for reading my question. Christophe ...

70. Generics problem; ...ClassCastException: java.lang.String    forum.hibernate.org

Hello, I'm having a problem with my Hibernate/Spring application, getting the following error while trying to display a Hibernate persisted pojo: Code: ERROR: Invalid property 'id' of bean class [ro.crispico.gioppi.model.Driver]: Getter for property 'id' threw exception; nested exception is java.lang.reflect.InvocationTargetException: null org.springframework.beans.InvalidPropertyException: Invalid property 'id' of bean class [ro.crispico.gioppi.model.Driver]: Getter for property 'id' threw exception; ...

71. Problems mapping too generic legacy database    forum.hibernate.org

Hibernate version: 3.1 Name and version of the database you are using:Oracle 10G I'm having problems mapping our legacy database schema. The problem is that it's actually created in a too generic way. I'll try to sketch the situation with a stripped down example: Code: TABLE OUR_OBJECTS columns: NUMBER ID VARCHAR ...

72. Generating map file for Generic classes?    forum.hibernate.org

Can somebody help me with where to look for information about how to go about annotating Generic classes so that a correct mapping file will be generated? If need be, I am willing to enhance the HbmWriter to do the job, but I'd rather not go off and re-invent the wheel if this problem has already been solved. TIA.

73. Article Generic Data Access Objects    forum.hibernate.org

74. How to map Java 5 generic types?    forum.hibernate.org

public class Employee extends Person { Integer id; public Integer getId() { return this.id; } public void setId(Integer id) { this.id = id; } //inherited name, birthDate ...

75. Generic BusinessClass->Attribute->AttributeValue Mappi    forum.hibernate.org

// load specific business-class objects from the DB BusinessClass bo1 = BusinessClassDAO.get(1); BusinessClass bo2 = BusinessClassDAO.get(3); AnotherBusinessClass bo3 = AnotherBusinessClassDAO.get(3); // load Attributes from the DB Attribute attributeA = AttributeDAO.get(1); Attribute attributeB = AttributeDAO.get(2); // attributeA now contains a set of all elements of class // AttributeValue this Attribute may have attributeA.printValues(); A B C D // attributeB now contains a ...

76. Problems in mapping generic associations    forum.hibernate.org

77. Generic class ?    forum.hibernate.org

Hello, I would like to use Hibernate. Currently, I use dods to map my java and my DB. But, we wish to evolve our platform. Is it possible to create a "generic" class "linked" with several tables. A strategy "Table per concrete class" (documentation section 9.1.5.) could correspond to our waiting. But in this case, we are required to create the ...

78. mapping of generic values table    forum.hibernate.org

Hi, It is possible to integrate Hibernate into the following DB-Schema and object model without changings of the structure? DB-Schema: UnitReport 1-n UnitReport_Attribute_Value n-1 Attribute UnitReport(Id, StartEndTime...) Attribute(Id, Name, DatatypeID) UnitReport_Attribute_Value (Id, ValueDouble, ValueString, ValueBoolean). The obj model looks as follows. Each UnitReport contains a Map of attribute and value pairs, whereas the attribute has the same structure such as the ...

79. ClassCastException when using Java5 Generics    forum.hibernate.org

public class Contract { // ... private InvoiceType invoice; public InvoiceType getInvoice() { return invoice; } public void setInvoice(InvoiceType invoice) { this.invoice = invoice; } }

80. How to use Generics    forum.hibernate.org

Need help with Hibernate? Read this first: http://www.hibernate.org/ForumMailingli ... AskForHelp Hibernate version: 3.0.x Name and version of the database you are using: MySQL 5.x with InnoDB Hi, I am all day looking for a way to map a generic class, like this Code: public class Version { protected Version() {} public Version( T data) {this.data ...

81. Mapping for generic classes    forum.hibernate.org

Hello i'm new to hibernate so i need a little help. I already googled for about 4 hours. Here's my problem I want to map a generic list like Code: public class ClassWithList { private List list; } So I have the following mapping file: Code: ...

82. proper mapping of java 5 generics as ArrayLists    forum.hibernate.org

Hibernate version: 3 First, thanks in advance for any help. My problem concerns the proper mapping of a Java 5 generic class as an ArrayList to non-generic classes. Here is the situation. I have a generic class called Range public class Range{ private long id; private Money charge; //Another user type private T min; private T max; . . . } ...

83. How to map java generics and wildcards    forum.hibernate.org

84. Generic findChildren API for 1-M relationship?    forum.hibernate.org

Hi All, I am just starting out on EJB3/hibernate and am having trouble implementing a generic findChildren API. What I'd like is an API that looks something like this public List findChildren(SomeEntity parent, String childrenProperty) I do realize, we can do parent.getChildren() but I want a more dynamic way to get children of a given entity. For eg. Given the following ...

85. unknown column, agregation function, generic type    forum.hibernate.org

select company0_.id as col_0_0_, 3*sum(brokers1_.loginCount)+15*sum(brokers1_.contacts)+5*sum(brokers1_.alreadySeenCount) as col_1_0_, company0_.id as id1_, from Company company0_ ...

86. Generic Entity: Is it possible ?    forum.hibernate.org

Hello everyone, I have an application that groups different objects using a Category entity. Of course, with Java5 Generics it is possible : Code: public class Category extends BaseObject { private String categoryName; private List entidades; private Long id; private List> subCategories; ...

87. How to map a generic type?    forum.hibernate.org

Hi, I am developing an application which would be greatly simplified by the use of Java 5 generics in the data layer. I was wondering if there is a way to map this (through hibernate annotatios, if possible) to the underlying database. I attach a piece of code to illustrate it: public class Incident { private Type event; public ...

88. Native generic sql query problem    forum.hibernate.org

I have to make native sql query without knowing in advace which query it will be, for example something like this: sqlQuery=... // a query string get from a input file from a socket List results = systemSession.createSQLQuery(sqlQuery).list(); is it possible in Hibernate? All the example i found need a scalar to be added or a entity class to be added, ...

89. Mapping a generic type as a property?    forum.hibernate.org

90. Cascade delete and 'generic' delete    forum.hibernate.org

91. Hibernate - Mapping of generic class    forum.hibernate.org

Hello All, I am using java 1.5 generics in my java classes. Is it possible to map the following classes to a database using Hibernate? Timeseries: This class represents a time series and consists of a set of timeseries elements. Code: public class Timeseries { private HashSet> timeseriesElemenets = new HashSet>(); ...

92. Can you persist a generic class in Hibernate?    forum.hibernate.org

93. Does hibernate support persisting clases contaning generics?    forum.hibernate.org

Hi , i'm new on this forum , i really spent a lot of time searching the web why i can't define a class which is defined in function of a generic type. To make the concept clear i have the class Broker defined as follows @Entity @DiscriminatorColumn(name="Type") public abstract class Broker { @Id@GeneratedValue(strategy=GenerationType.AUTO) private Integer ...

94. Mapping Generic Properties    forum.hibernate.org

Hi Guys I am attempting to map a many-to-many relationship so that a Customer can have many "Properties" and each property is of a specific PropertyType. The mapping looks like: Code: CUSTOMER_ID_SEQ ...

95. Java generics & hibernate mapping    forum.hibernate.org

hi, I m a newbie to Hibernate. I have a Java, HashMap. I have regular map declaration in .hbm.xml. But hibernate needs explicit declaration for MyClass in .hbm.xml. It then creates table corresponding to MyClass with only primary keys. Is there a way to declare MyClass as a component of Map, so hibernate does not create another independant table called ...

96. HibernateMappingExcepion when using Generics    forum.hibernate.org

...

97. How to fix this? Problem with xdoclet and generics.    forum.hibernate.org

I'm using xdoclet version 1.2.3 to build map files .hbm.xml to Hibernate. It was working all fine, but when I start to work with Generics, something was wrong. I got the follow error mesage: ========================================= [hibernatedoclet] Error parsing File /home/cris/dev/projetos/java/lib/autox/modulo_principal_servicos/src/com/autox/m\ odulos/principal/servicos/pojos/UsuarioTipo.java:Encountered "<" at line 13, column 14. [hibernatedoclet] Was expecting one of: [hibernatedoclet] ... [hibernatedoclet] "[" ... [hibernatedoclet] "." ... ...

98. mapping multiple tables to a single generic object    forum.hibernate.org

Hi, I'm hoping to use hibernate .hbm files for out situation where we need to be able to add tables at runtime. I looked into dynamically generating the source for the corresponding domain objects and compiling them but it seemed too awkward. So, I'm wondering if its possible to map tables to a common generic object? Something like an object containing ...

99. mapping of generic class    forum.hibernate.org

100. support for .NET Generics - caveat?    forum.hibernate.org