liquibase.change

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database Client » LiquiBase » liquibase.change 
liquibase.change
Java Source File NameTypeComment
AbstractChange.javaClass Standard superclass for Changes to implement.
AbstractChangeTest.javaClass
AbstractSQLChange.javaClass A common parent for all SQL related changes regardless of where the sql was sourced from.
AbstractSQLChangeTest.javaClass
AddAutoIncrementChange.javaClass Makes an existing column into an auto-increment column.
AddAutoIncrementChangeTest.javaClass
AddColumnChange.javaClass Adds a column to an existing table.
AddColumnChangeTest.javaClass
AddDefaultValueChange.javaClass Sets a new default value to an existing column.
AddDefaultValueChangeTest.javaClass
AddForeignKeyConstraintChange.javaClass Adds a foreign key constraint to an existing column.
AddForeignKeyConstraintChangeTest.javaClass
AddLookupTableChange.javaClass Extracts data from an existing column to create a lookup table.
AddNotNullConstraintChange.javaClass Adds a not-null constraint to an existing column.
AddNotNullConstraintChangeTest.javaClass
AddPrimaryKeyChange.javaClass Creates a primary key out of an existing column or set of columns.
AddPrimaryKeyChangeTest.javaClass
AddUniqueConstraintChange.javaClass Adds a unique constraint to an existing column.
AddUniqueConstraintChangeTest.javaClass
AlterSequenceChange.javaClass Modifies properties of an existing sequence.
AlterSequenceChangeTest.javaClass
Change.javaInterface Interface all changes (refactorings) implement.

How changes are constructed and run when reading changelogs:

  1. As the changelog handler gets to each element inside a changeSet, it passes the tag name to liquibase.change.ChangeFactory which looks through all the registered changes until it finds one with matching specified tag name
  2. The ChangeFactory then constructs a new instance of the change
  3. For each attribute in the XML node, reflection is used to call a corresponding set* method on the change class
  4. The correct generateStatements(*) method is called for the current database

To implement a new change:

  1. Create a new class that implements Change (normally extend AbstractChange)
  2. Implement the abstract generateStatements(*) methods which return the correct SQL calls for each database
  3. Implement the createMessage() method to create a descriptive message for logs and dialogs
  4. Implement the createNode() method to generate an XML element based on the values in this change
  5. Add the new class to the liquibase.change.ChangeFactory

Implementing automatic rollback support

The easiest way to allow automatic rollback support is by overriding the createInverses() method. If there are no corresponding inverse changes, you can override the generateRollbackStatements(*) and canRollBack() methods.

Notes for generated SQL:
Because migration and rollback scripts can be generated for execution at a different time, or against a different database, changes you implement cannot directly reference data in the database.

ChangeFactory.javaClass Factory class for constructing the correct liquibase.change.Change implementation based on the tag name. It is currently implemented by a static array of Change implementations, although that may change in later revisions.
ChangeFactoryTest.javaClass
ColumnConfig.javaClass This class is the representation of the column tag in the XMl file It has a reference to the Constraints object for getting information about the columns constraints.
ColumnConfigTest.javaClass
ConstraintsConfig.javaClass This class is resposible for holding the information about all the constraints imposed on the column.
ConstraintsConfigTest.javaClass
CreateIndexChange.javaClass Creates an index on an existing column.
CreateIndexChangeTest.javaClass
CreateProcedureChange.javaClass
CreateProcedureChangeTest.javaClass
CreateSequenceChange.javaClass Creates a new sequence.
CreateSequenceChangeTest.javaClass
CreateTableChange.javaClass Creates a new table.
CreateTableChangeTest.javaClass
CreateViewChange.javaClass Creats a new view.
CreateViewChangeTest.javaClass
DeleteDataChange.javaClass
DropColumnChange.javaClass Drops an existing column from a table.
DropColumnChangeTest.javaClass
DropDefaultValueChange.javaClass Removes the default value from an existing column.
DropDefaultValueChangeTest.javaClass
DropForeignKeyConstraintChange.javaClass Drops an existing foreign key constraint.
DropForeignKeyConstraintChangeTest.javaClass
DropIndexChange.javaClass Drops an existing index.
DropIndexChangeTest.javaClass
DropNotNullConstraintChange.javaClass Drops a not-null constraint from an existing column.
DropNotNullConstraintChangeTest.javaClass
DropPrimaryKeyChange.javaClass Removes an existing primary key.
DropPrimaryKeyChangeTest.javaClass
DropSequenceChange.javaClass Drops an existing sequence.
DropSequenceChangeTest.javaClass
DropTableChange.javaClass Drops an existing table.
DropTableChangeTest.javaClass
DropUniqueConstraintChange.javaClass Removes an existing unique constraint.
DropUniqueConstraintChangeTest.javaClass
DropViewChange.javaClass Drops an existing view.
DropViewChangeTest.javaClass
ExecuteShellCommandChange.javaClass Executes a given shell executable.
InsertDataChange.javaClass Inserts data into an existing table.
InsertDataChangeTest.javaClass
MergeColumnChange.javaClass Combines data from two existing columns into a new column and drops the original columns.
ModifyColumnChange.javaClass Modifies the data type of an existing column.
ModifyColumnChangeTest.javaClass
RawSQLChange.javaClass Allows execution of arbitrary SQL.
RawSQLChangeTest.javaClass
RenameColumnChange.javaClass Renames an existing column.
RenameColumnChangeTest.javaClass
RenameTableChange.javaClass Renames an existing table.
RenameTableChangeTest.javaClass
RenameViewChange.javaClass Renames an existing view.
RenameViewChangeTest.javaClass
SQLFileChange.javaClass Represents a Change for custom SQL stored in a File.
SQLFileChangeTest.javaClass Tests the SQL File with a simple text file.
UpdateDataChange.javaClass
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.