0

I have Bridge class:

public class Bridge extends Attribute{
    String name;
    //getters and setters
}

this class used for mapping. Bridge.hbm.xml:

<?xml version="1.0" ?>
<!DOCTYPE hibernate-mapping PUBLIC
    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>
    <class name="pack.persistent.Bridge" table="bridge">
        <property name="name"/>
    </class>
</hibernate-mapping>

Attribute class also:

public class Attribute{
    String description;
    //gettors, setters & something else
}

When I use Google GenericDAO framework for searching some entity using filter I can search only by name field, but not by description.

How can I use Search and Filter classes from Google GenericDAO framework for seaching not mapped class objects?

Alexiuscrow
  • 717
  • 13
  • 29

1 Answers1

0

you need to add the field description in Bridge.hbm.xml

<hibernate-mapping>
    <class name="pack.persistent.Bridge" table="bridge">
        <property name="name"/>
        <property name="description"/>
    </class>
</hibernate-mapping>
Mudassar
  • 2,669
  • 13
  • 21
  • but in this case will be added new field to my databese. I dont want it. – Alexiuscrow Jun 15 '15 at 14:23
  • Hmm but how will you search for description if it doesn't fill up from the database. Is it being filled logically within the code ? – Mudassar Jun 15 '15 at 15:00
  • Hi, Kindly let me know if this solution helped or if you found better alternative. – Mudassar Jun 19 '15 at 12:35
  • Kindly let me know if the proposed solution helped you or if you had some problem with the proposed steps. If it has fulfilled the problem solution then kindly accept the solution. – Mudassar Jun 24 '15 at 09:39