tailieunhanh - Apress bắt đầu ứng dụng với java google - p 18

Xây dựng chỉ số Khi chạy, nếu App Engine thực hiện một truy vấn không có chỉ số tương ứng, nó sẽ thất bại thảm hại. Theo mặc định, App Engine xây dựng một số chỉ số đơn giản cho bạn. Đối với các chỉ số phức tạp hơn, bạn sẽ phải xây dựng chúng bằng tay trong file cấu hình chỉ số, như trong ví dụ 7-2. | CHAPTER 7 USING THE APP ENGINE DATASTORE Building Indexes At runtime if App Engine executes a query with no corresponding index it will fail miserably. By default App Engine builds a number of simple indexes for you. For more complex indexes you will have to build them manually in the index configuration file as shown in Listing 7-2. Listing 7-2. Sample file xml version encoding utf-8 datastore-indexes xmlns http ns datastore-indexes autoGenerate true datastore-index kind Contact ancestor false property name countryName direction asc datastore-index datastore-indexes Indexes are built automatically by App Engine for queries that contain Single property inequality filters Only one property sort order ascending or descending and no filters Inequality or range filters on keys and equality filters on properties Only ancestor and equality filters You must specify in the index configuration file any queries containing Multiple sort orders Inequality and ancestor filters A sort order on multiple keys in descending order One or more inequality filters on a property and one or more equality filters over the properties Creating Indexes In Development Mode During development App Engines tries to create your indexes for you in the configuration file. If the development web server encounters a query that does not have a corresponding index it will try to create an index for you automatically. If your unit tests call every possible query for your application the generated configuration file will contain a complete set of all indexes. This is where confusion creeps into the process. If 148 CHAPTER 7 USING THE APP ENGINE DATASTORE you think your tests call all possible queries but your application still fails at runtime you ll have to edit the file and add these indexes manually. Using Transactions At a high level the App Engine datastore supports transactions like most relational databases. A transaction .

crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.