Version 4

    EJB 3.0 TrailBlazer: &12495;&12452;&12461;&12531;&12464; 3: &27704;&32154;&24615;&12392;&12487;&12540;&12479;&12505;&12540;&12473;&12450;&12463;&12475;&12473;(Persistence and Database Acccess)

     

    The EJB 3.0 entity beans are used to model and access relational database tables. It is a completely POJO-based persistence framework that should come natural to most Java developers.

     

    EJB 3.0 &12456;&12531;&12486;&12451;&12486;&12451;Bean&12399;&12289;&12522;&12524;&12540;&12471;&12519;&12490;&12523;&12487;&12540;&12479;&12505;&12540;&12473;&12398;&12486;&12540;&12502;&12523;&12434;&12514;&12487;&12523;&21270;&12375;&12289;&12450;&12463;&12475;&12473;&12377;&12427;&12383;&12417;&12395;&20351;&29992;&12373;&12428;&12414;&12377;&12290;&12381;&12428;&12399;&23436;&20840;&12395;POJO&12505;&12540;&12473;&12398;&27704;&32154;&12501;&12524;&12540;&12512;&12527;&12540;&12463;&12394;&12398;&12391;&12289;&12411;&12392;&12435;&12393;&12398;Java&38283;&30330;&32773;&12395;&12392;&12387;&12390;&33258;&28982;&12395;&25201;&12360;&12427;&12399;&12378;&12391;&12377;&12290;

     

    If you are familiar with Hibernate or TopLink, you will find the EJB 3.0 very intuitive, as its design model is strongly influenced by the Hibernate and TopLink approach of Object / Relational mapping. Even if you do not have much experience with complex database programming in Java, you will also find EJB 3.0 entity beans very easy to learn. All you need is to model your application data in simple POJOs. Then, with a set of simple annotations, the container figures out how to map the Java objects into tables in relational databases. Using the EntityManager API, you can operate the relational database as if they store Java objects instead of rows of relational data.

     

    Hibernate&12420;TopLink&12395;&24931;&12428;&35242;&12375;&12435;&12384;&26041;&12394;&12425;&12289;EJB 3.0&12399;&12392;&12390;&12418;&30452;&24863;&30340;&12391;&12354;&12427;&12392;&24863;&12376;&12427;&12371;&12392;&12391;&12375;&12423;&12358;&12290;&12394;&12380;&12394;&12425;&12289;&12381;&12398;&35373;&35336;&12514;&12487;&12523;&12399;Hibernate&12392;TopLink&12398;O/R&12510;&12483;&12500;&12531;&12464;(Object / Relational mapping)&12398;&12450;&12503;&12525;&12540;&12481;&12395;&24375;&12367;&24433;&38911;&12434;&21463;&12369;&12390;&12356;&12427;&12363;&12425;&12391;&12377;&12290;Java&12391;&12398;&35079;&38609;&12394;&12487;&12540;&12479;&12505;&12540;&12473;&12398;&12503;&12525;&12464;&12521;&12511;&12531;&12464;&12398;&32076;&39443;&12364;&12394;&12356;&12392;&12375;&12390;&12418;&12289;EJB 3.0 &12456;&12531;&12486;&12451;&12486;&12451;Bean&12399;&12392;&12390;&12418;&23398;&32722;&12375;&12420;&12377;&12356;&12371;&12392;&12395;&27671;&12389;&12367;&12371;&12392;&12391;&12375;&12423;&12358;&12290;&24517;&35201;&12394;&12371;&12392;&12399;&31777;&21336;&12394;POJO&12395;&12424;&12387;&12390;&12450;&12503;&12522;&12465;&12540;&12471;&12519;&12531;&12398;&12487;&12540;&12479;&12434;&12514;&12487;&12523;&21270;&12377;&12427;&12371;&12392;&12384;&12369;&12391;&12377;&12290;&27425;&12395;&12289;&31777;&21336;&12394;&12450;&12494;&12486;&12540;&12471;&12519;&12531;&12434;&25351;&23450;&12377;&12427;&12371;&12392;&12395;&12424;&12387;&12390;&12289;&12467;&12531;&12486;&12490;&12399;Java&12458;&12502;&12472;&12455;&12463;&12488;&12434;&12522;&12524;&12540;&12471;&12519;&12490;&12523;&12487;&12540;&12479;&12505;&12540;&12473;&12398;&12486;&12540;&12502;&12523;&12408;&22793;&25563;&12377;&12427;&26041;&27861;&12434;&29702;&35299;&12375;&12414;&12377;&12290;EntityManager API&12434;&20351;&12360;&12400;&12289;&12522;&12524;&12540;&12471;&12519;&12490;&12523;&12487;&12540;&12479;&12398;&20195;&12431;&12426;&12395;&12354;&12383;&12363;&12418;Java&12458;&12502;&12472;&12455;&12463;&12488;&12434;&26684;&32013;&12377;&12427;&12363;&12398;&12424;&12358;&12395;&12522;&12524;&12540;&12471;&12519;&12490;&12523;&12487;&12540;&12479;&12505;&12540;&12473;&12434;&25805;&20316;&12377;&12427;&12371;&12392;&12364;&12391;&12365;&12414;&12377;&12290;

     

    In this hike, we will go through trails that explore the key features of the EJB 3.0 entity bean programming model and the EntityManager API. Let's start with a discussion on how Object / Relational Mapping technology works in EJB 3.0.

     

    &12371;&12398;&12495;&12452;&12461;&12531;&12464;&12391;&12399;&12289;&23567;&36947;&12434;&36914;&12415;&12394;&12364;&12425;EJB 3.0 &12456;&12531;&12486;&12451;&12486;&12451;Bean&12398;&12503;&12525;&12464;&12521;&12511;&12531;&12464;&12514;&12487;&12523;&12392;Entity Manager API&12398;&12461;&12540;&12392;&12394;&12427;&29305;&24500;&12434;&25506;&32034;&12375;&12390;&12356;&12365;&12414;&12377;&12290;&12381;&12428;&12391;&12399;&12289;EJB 3.0&12395;&12362;&12356;&12390;O/R&12510;&12483;&12500;&12531;&12464;&12364;&12393;&12398;&12424;&12358;&12395;&21205;&20316;&12377;&12427;&12398;&12363;&12395;&12388;&12356;&12390;&35696;&35542;&12434;&22987;&12417;&12414;&12375;&12423;&12358;&12290;

     

    Note: The EJB 3.0 entity beans are completely different from and much easier to use compared with the old EJB 2.1 entity beans.

     

    &27880;&24847;&65306;EJB 3.0 &12456;&12531;&12486;&12451;&12486;&12451;Bean&12399;&12289;&26087; EJB 2.1 &12456;&12531;&12486;&12451;&12486;&12451;Bean&12392;&27604;&12409;&12427;&12392;&12414;&12387;&12383;&12367;&30064;&12394;&12427;&12418;&12398;&12391;&12289;&20351;&12358;&12398;&12364;&12424;&12426;&31777;&21336;&12395;&12394;&12387;&12390;&12356;&12414;&12377;&12290;

     

    エンティティBeanのO/Rマッピング

     

    This trail shows how to use entity beans (POJOs) to map a set of Java objects to inter-connected relational database tables. We will cover how to specify the relationship between objects. The EJB 3.0 container generates the right schema and SQL statements.

     

    &12371;&12398;&23567;&36947;&12399;Java&12458;&12502;&12472;&12455;&12463;&12488;&12434;&20869;&37096;&12391;&38306;&36899;&20184;&12369;&12425;&12428;&12383;&12522;&12524;&12540;&12471;&12519;&12490;&12523;&12487;&12540;&12479;&12505;&12540;&12473;&12398;&12486;&12540;&12502;&12523;&12408;&22793;&25563;&12377;&12427;&12383;&12417;&12395;Entity Bean&65288;POJO)&12434;&20351;&12358;&26041;&27861;&12434;&31034;&12375;&12414;&12377;&12290;&12458;&12502;&12472;&12455;&12463;&12488;&38291;&12398;&38306;&20418;&12434;&25351;&23450;&12377;&12427;&26041;&27861;&12418;&25201;&12356;&12414;&12377;&12290;EJB 3.0&12467;&12531;&12486;&12490;&12399;&27491;&12375;&12356;&12473;&12461;&12540;&12510;&12392;SQL&25991;&12434;&29983;&25104;&12375;&12414;&12377;&12290;

     

    EntityManagerの基本

     

    Since the EJB 3.0 entity bean is a POJO, you can simply use the Java new keyword to create an instance. This trail shows how to use the EJB 3.0 EntityManager interface to persist entity bean instances into the database and then retrieve them to perform investment calculations.

     

    EJB 3.0&12456;&12531;&12486;&12451;&12486;&12451;Bean&12399;POJO&12394;&12398;&12391;&12289;&12452;&12531;&12473;&12479;&12531;&12473;&12398;&29983;&25104;&12399;Java&12398;new&12461;&12540;&12527;&12540;&12489;&12434;&20351;&12358;&12384;&12369;&12391;&21487;&33021;&12391;&12377;&12290;&12371;&12398;&23567;&36947;&12399; &12289;&25237;&36039;&35336;&31639;&12434;&23455;&34892;&12377;&12427;&12383;&12417;&12395;EJB 3.0 EntityManager&12452;&12531;&12479;&12501;&12455;&12540;&12473;&12434;&20351;&12387;&12390;&12456;&12531;&12486;&12451;&12486;&12451;Bean&12452;&12531;&12473;&12479;&12531;&12473;&12434;&12487;&12540;&12479;&12505;&12540;&12473;&12395;&27704;&32154;&21270;&12375;&12289;&27425;&12395;&12381;&12428;&12425;&12434;&21462;&24471;&12377;&12427;&12377;&12427;&26041;&27861;&12434;&31034;&12375;&12414;&12377;&12290;

     

    EJBクエリーによるデータベース検索

     

    This trail discusses the data query language and API in EJB 3..0 The EntityManager supports a SQL-like query language to search the database and retrieve matching data in a collection of entity bean objects.

     

    &12371;&12398;&23567;&36947;&12399;EJB 3.0&12398;&12487;&12540;&12479;&12463;&12456;&12522;&12540;&35328;&35486;&12395;&12388;&12356;&12390;&35696;&35542;&12375;&12414;&12377;&12290;EntityManager&12399;&12487;&12540;&12479;&12505;&12540;&12473;&26908;&32034;&12420;&12456;&12531;&12486;&12451;&12486;&12451;Bean&12458;&12502;&12472;&12455;&12463;&12488;&12398;&12467;&12524;&12463;&12471;&12519;&12531;&12363;&12425;&19968;&33268;&12377;&12427;&12487;&12540;&12479;&12434;&21462;&24471;&12377;&12427;&12383;&12417;&12395;SQL&12521;&12452;&12463;&12394;&12463;&12456;&12522;&12540;&35328;&35486;&12434;&12469;&12509;&12540;&12488;&12375;&12414;&12377;&12290;

     

    データベースの更新と同期

     

    This trail discusses how to update existing data rows in the database by modifying the entity bean instances in Java programs, and how those changes are synchronized to the database.

     

    &12371;&12398;&23567;&36947;&12399;Java&12503;&12525;&12464;&12521;&12512;&20869;&12391;&12456;&12531;&12486;&12451;&12486;&12451;Bean&12452;&12531;&12473;&12479;&12531;&12473;&12434;&22793;&26356;&12377;&12427;&12371;&12392;&12391;&29694;&23384;&12377;&12427;&12487;&12540;&12479;&34892;&12434;&26356;&26032;&12377;&12427;&26041;&27861;&12392;&12381;&12428;&12425;&12398;&22793;&26356;&12434;&12487;&12540;&12479;&12505;&12540;&12473;&12395;&21516;&26399;&12377;&12427;&26041;&27861;&12434;&35696;&35542;&12375;&12414;&12377;&12290;

     

    エンティティBeanのライフサイクル

     

    This trail discusses the life cycle of an entity bean, and how to automate the behavior of entity beans via callback methods.

     

    &12371;&12398;&23567;&36947;&12399;&12456;&12531;&12486;&12451;&12486;&12451;Bean&12398;&12521;&12452;&12501;&12469;&12452;&12463;&12523;&12392;&12289;&12467;&12540;&12523;&12496;&12483;&12463;&12513;&12477;&12483;&12489;&12434;&20351;&12387;&12390;&12456;&12531;&12486;&12451;&12486;&12451;Bean&12398;&25391;&12427;&33310;&12356;&12434;&33258;&21205;&21270;&12377;&12427;&26041;&27861;&12434;&35696;&35542;&12375;&12414;&12377;&12290;

     

    永続コンテキストの設定

     

    This trail discusses how to use entity beans with databases other than the default embedded HSQLDB. We will also discuss the concepts of multiple persistence context and the persistence archive packaging.

     

    &12371;&12398;&23567;&36947;&12399;&12487;&12501;&12457;&12523;&12488;&32068;&12415;&36796;&12415;HSQLDB&20197;&22806;&12398;&12487;&12540;&12479;&12505;&12540;&12473;&12391;&12456;&12531;&12486;&12451;&12486;&12451;Bean&12434;&20351;&12358;&26041;&27861;&12434;&35696;&35542;&12375;&12414;&12377;&12290;&35079;&25968;&12398;&27704;&32154;&12467;&12531;&12486;&12461;&12473;&12488;&12398;&27010;&24565;&12420;&27704;&32154;&24615;&12398;&12450;&12540;&12459;&12452;&12502;&12398;&12497;&12483;&12465;&12540;&12472;&12531;&12464;&12418;&35696;&35542;&12375;&12414;&12377;&12290;

     

    c2002-2005 JBoss Inc. All rights reserved. JBoss is a registered trademark and servicemark of JBoss, Inc.

    Privacy Policy