Register / Login
Win a copy of
Java 9 Revealed
this week in the
Features new in Java 9
this forum made possible by our volunteer staff, including ...
Roel De Nijs
Stephan van Hulst
Object Relational Mapping
posted 12 years ago
I have a Team object which has an array of Players object. (mapping file below) . now I want to build a query, select one team object when this team object's name ='dd' and
players object's name='bb'.
my coding is wrong, I don't know why .
<hibernate-mapping> <class name="example.Team" table="teams" > ....... <property name="city" column="city" type="string" length="15" not-null="true"/> <set name="players" cascade="all" inverse="true" lazy="true"> <key column="team_id"/> <one-to-many class="example.Player"/> </set> </class> <query name="findTeamByName"> <![CDATA[ select team from example.Team as team, example.Team.Players as player where team.name = 'dd' and player.firstName = 'bb' ]]> </query> </hibernate-mapping>
Boost this thread!
how to save collection object into database
One to many Relation
One to Many && Many to One mapping
could not initialize a collection+ [Microsoft][ODBC SQL Server Driver]Invalid Descrip